So I need to setup a server sided timer that I’m guessing will work with os.time, the only problem is i have not got a clue how to do it, I need it to start a timer after a bank has been robbed after the timer is finished i need it to trigger a client event which will be the easy part!
Any help will be greatly appreciated!
Cheers!
bump
[20char]
Why not do a new thread after the job has been complete and initiate a Citizen.Wait function then continue what you want to trigger after that?
i.e.
Citizen.CreateThread(function()
Citizen.Wait(5000)
TriggerClientEvent('whateverEvent')
end)
I assume they are trying to setup a server wide cool down for bank robbery. So if anyone robs the bank it can not be robbed again for certain amount of time. Let me see what i can work up for you.
Use os.time() to note the time of last robbery and save it in a table, then when someone tries to rob compare current time vs the saved time + cooldown.
Like Spike said Im trying to make it a server wide cooldown if i did a citizen wait on the client and they relog they could just do the robbery again and I dont want that, Cheers for the help tho.
@imTiMoN The only problem with that is I don’t have a clue where to start haha.
@SpikE_Odets Cheers man hope to hear from you soon 
Do you have a table with each bank as a seperate key?
its just 1 bank I am doing atm its almost finished i just need to learn how to setup a server sided timer, i basically have a timer for a “lockdown” that happens when it reaches 0 all the doors close and after that i need to trigger the bank robbery as finished and then put a cooldown of how ever long seems right in order to make it so people can just reconnect and do the robbery again, I looked into the esx_holdbank and I just cant make sense of how it works. If you need to see anything or have anything that can point me in the right direction that would be great
Cheers!
bump
[20char]
Sorry after what @imTiMon said I didn’t look any farther into it. Seems simple enough process when bank heist is finished you want to set the cool down timer. Just send server side command to set os.time() into sql database and if anyone tries to start heist - have that script check to see if the os.time < lastrobtime + 30:00 or something similart to that… where lastrobtime is pulled from sql.
Doesn’t need to be a server side timer… more a time stamp of last completed robbery and then just check against that.
Hopefully this helps you figure out which direction to head in your script.
SpikE
Solved i did it like this:
if xPlayer.getInventoryItem('raspberrypi').count <= 0 then
TriggerClientEvent('esx:showNotification', source, '~h~~r~You don\'t have the correct equipment.')
elseif (cops < Config.NumberOfCopsRequired)then
TriggerClientEvent('esx:showNotification', source, '~h~~r~Not enough cops in town.')
elseif (os.time() - Config.lastrobbed) < 600 and Config.lastrobbed ~= 0 then
TriggerClientEvent('esx:showNotification', source, _U('already_robbed') .. (1800 - (os.time() - Config.lastrobbed)) .. _U('seconds'))
elseif (cops >= Config.NumberOfCopsRequired)then
if xPlayer.getInventoryItem('raspberrypi').count >= 1 then
TriggerClientEvent('bankrob:HasGotRaspDoor', source, GotRaspDoor)
end
end
end)
and added this to where i wanted to timer to start:
Config.lastrobbed = os.time()
Will setting Config set the time for anyone that gets on the server after it has been robbed. Test this buy doing a robbery and have a friend sign on two mins later and see if he can start.
I have tried it with friends where they have triggered the cooldown timer and then I log in, it seems to be fine so far 
Very nice… did think about the config file being downloaded each time you connect so would be updated for everyone even after they join. Much easier then doing sql. If you decide to do multiple bank cool downs might be easier to do sql entry and pull… but this seems like a very good fix for what you were looking for.
I did the pacific bank this time around and thought it deserved its own resource, I’ll be doing the little fleeca banks next so I will defiantly keep this in mind when doing that, I’ve not done too bad to say its my first time working with LUA, I’m very happy how its come out so far, Thanks for all the info you have given me! 
Can u send the full code if u mind 