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

Is it possible to calculate how long a player has been offline?

Asked by
trecept 367 Moderation Voter
5 years ago

Can I calculate somehow how long a player has been offline as in how long they have not played the game for? Like if they take a 1 hour break or play the next day (48 hours) etc? I'm assuming I can use datastores but I don't know how I'd save the time to compare?

3
You could save the time that tick() returns and then subtract the new tick() when they join to see how long since they joined. User#21908 42 — 5y
0
That makes no sense xxcoordinatorxx 135 — 5y
1
Yes. It does. You can also use data stores @OP in conjunction with Phlegethon5778's idea but I recommend you use os.time() instead User#19524 175 — 5y
0
Thank you for the help guys, I know how I'll do this now trecept 367 — 5y
0
np User#21908 42 — 5y

Answer this question