How can i make a timer continue for the player even after he left?

What the title says, basically the timer is 24 hours and should continue even when the player is offline.

2 Likes

Might sound a bit complicated but here’s my guess.

When they leave, you could make a new thread or coroutine that handles their timer. For every second past, add one to their value.

If the server gets shut down or closed, then you would have to save their time/data they had before the server closes down everything, then when they join back, you take the current time if they joined the server, and the subtract it to the last data/time they had in the other server. Then, you get the result and add it to the last data/time they had in the other server to get the final result.

U can use the OsTime for test, here is 2 videos if u need:

Live event => Same time for all players.
Daily reward => Its for only one player the countdown.

6 Likes

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.