Jump to content

timer math.random?


Bean666

Recommended Posts

    local time = {56333,3292,2123} ---<<-- Make sure to have numbers above 50 
    local random = math.random(0,#time) 
    timer = setTimer(function() 
        --stuff here-- 
        end, time[random], 0) 

Oh yeh sorry forgot, make sure that the numbers are all above 50. If you wanted to use math.random to make the number ->

local number = math.random(50,5000) 

-- Chooses a number in-between 50 and 5000

Link to comment
  
local timerfrom, timerto = 5,30  --Time in minutes   
function setRandomTimer ( ) 
    startTimer = setTimer( function ( ) 
    end , math.random ( timerfrom, timerto ) * 60 * 1000 , 1 ) 
end 
addEventHandler ("onResourceStart", resourceRoot, function ( ) setRandomTimer ( ) 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...