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

Can I make a script wait a random amount of time?

Asked by 10 years ago

So can I make a script wait a random amount of time? But still wait somewhere between 1 and 10 seconds? I used to know how to this but I forgot.

1 answer

Log in to vote
1
Answered by
jmt99 35
10 years ago
Edited 6 years ago

Please provide explanation with your answers. Simply posting code does not spread knowledge of integral scripting processes which helps people understand the logic and reasoning behind your answer.
wait(math.random(1, 10))

math.random() generates a random number within a specific range. In this example, it would be from 1 to 10.

wait() waits a specified number of seconds, in this case, it would be the random number generated by math.random()

0
Thank you SyndicateHalo 40 — 10y
Ad

Answer this question