Page 1 of 1

Using math.random function in timers [Solved]

Posted: Sat Oct 29, 2011 6:21 pm
by Noobasaurus
How would one get a random timer value between two numbers? Say you want it between 500 and 600...how would you do that in a timer?

Re: Using math.random function in timers

Posted: Sat Oct 29, 2011 6:27 pm
by DarthD.U.C.K.
have you tried that?

Code: Select all

duration = math.random(500,600)
SetTimerValue(timername, duration)

Re: Using math.random function in timers

Posted: Sat Oct 29, 2011 7:38 pm
by DarthXeon
i wanna see what your trying to make with the timer noobasarus i bet its something cool :)

Re: Using math.random function in timers

Posted: Sat Oct 29, 2011 8:23 pm
by Noobasaurus
DarthD.U.C.K. wrote:have you tried that?

Code: Select all

duration = math.random(500,600)
SetTimerValue(timername, duration)
No I haven't, thanks. Trying it right now.
DarthXeon wrote:i wanna see what your trying to make with the timer noobasarus i bet its something cool :)
It's something for the hard mode on Gamorrean Attack...so that you can't time it...

EDIT: Yup, it works, thanks. :)