Jump to content

math.random in timer?


bamby12

Recommended Posts

i almost sure it will choose one delay time, and it will keep it forever (or until script restarts).

if you want make timer and each time it should use new random delay value for next executing - set repeat count to "1" and inside timer put setTimer(func, random_here, 1). like:

  
setTimer(func, math.random(12000, 500000), 1) 
function func() 
  setTimer(func, math.random(12000, 500000), 1) 
  -- other actions 
end 
  

Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...