• help with math.random
    5 replies, posted
Hey, so i have this code so far: houses = { "Hufflepuff", "Gryffindor", "Slytherin", "Ravenclaw" } classrooms = { "Class 1", "Class 2", "Class 3", "Class 4" } classes = { "Charms", "Wizardry", "Muggle Studies", "DADA", "Transfiguration", "History of Magic", "Herbology", "Astronomy", "Potions", "Quidditch", "Free Time", "Great Hall", "Lock Down" } concommand.Add( "newclass", function( ply, cmd, args ) print( "I pick" .. houses[math.random( 1, #houses )] .. "to go to" .. classes[math.random( 1, #classes )] .. "in class room".. classrooms[math.random( 1, #classrooms )] ) end ) I was wondering if anyone could help me write a code that would get the output of a class and assign a certain classroom. Example: if table.random for classes is "Potions", then (i'll do my code)
Make it a variable and do an if statement?
what are you trying to make with this ?
im a little bit new to lua, i'm not sure how to do this. im making a hogwarts class system for hogwarts rp, going to release it for free
way ahead of you :3
this is solved, i got it working.
Sorry, you need to Log In to post a reply to this thread.