math.random help

I’m playing around with a addon and it uses a timer to trigger a event, and I’m just wondering if someone could explain or help me with this.

math.random( 1 * 60 * 60, 7 * 60 * 60 )
math.random( 10 * 60, 30 * 60 )
math.random( 1 * 60 * 60, 7 * 60 * 60 )

How would i make it slower…?
All i know that the timer is in seconds.
Also what does this total up to?

[lua]timer.Simple(.1, function() math.random( 1 ) end)[/lua]

I don’t think my question was stated correctly.
i was wondering how much it was totaled up to, and how i would slow down the timer.

math.random generates a random whole number between two intervals.

If you don’t give it any arguments ( math.random( ) ) it returns a random float between 0 and 1.
If you give it a single argument( math.random( N ) ), it returns an integer between 1 and N.
If you give it two arguments( math.random( N, O ) ), it returns an integer between N and O.

So, if by slower you mean you want it to occur later, you could simply raise both values.

The first timer will fire between an hour and seven hours later. The second between ten and thirty minutes.

I’m not sure what else you would need to know, so do clarify what you want if this doesn’t help.

Thanks, but what does the “1 * 60 * 60” mean in…
math.random( 1 * 60 * 60, 7 * 60 * 60 )

It means one times sixty times sixty.

A minute is 60 seconds, and hour is 3600 seconds.

So 60 * 60 means one hour.

1 * 60 * 60 is one hour, while 7 * 60 * 60 is 7 hours.

I thought so, but i wasn’t to sure, thanks :slight_smile: