Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

How do I use Math Random?

Asked by
NecoBoss 194
9 years ago

I have been trying to figure out how to use the mathrandom to generate a random wait time from 50 to 100 seconds. Can anybody help?

2 answers

Log in to vote
2
Answered by 9 years ago

Ok.. Math.random() does a random number that is between one and another number, so if you are doing 50 and 100, math.random(50,100) would choose a random number between 50 and 100. I hope this helped! ;)

Ad
Log in to vote
1
Answered by 9 years ago

Simple.

numbers={3,5,6,2,9,1}

function Entered()
    print(math.random#numbers)
end

game.Players.PlayerAdded:connect(Entered)

Answer this question