Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Timer while away (?)

Asked by 8 years ago

I would like to know how users like loleris make timers that work while a player is out of the game to reward a currency after that amount of time. If there is a wiki page for this, please refer me to it. Any help or explanation would help. Note: I only want to know how to make the timer, I don't want to reward the user with currency.

1 answer

Log in to vote
0
Answered by 8 years ago

What you need to use is something called os.time Wiki Link

When called without arguments, returns the number of seconds since the epoch (1 January 1970, 00:00:00). This differs from tick(): tick() returns the number of seconds since the epoch from the current system time. os.time() returns this time of seconds since the UTC time, meaning that this will (theoretically) be the same on all systems
When called with a date table, os.time will return the timestamp which belongs to that date table

0
I'll accept it because I've figured out a way to manipulate it. jimborimbo 94 — 8y
0
Ok cool pluginfactory 463 — 8y
Ad

Answer this question