Script that performs action while servers are closed

This is a poorly written title but I don’t know how to describe it.

Have you ever played a game with daily gifts where you have to wait exactly 24 to receive another daily gift? What service or tool do those scripts use? How can I time something while a server is closed?

Thanks in advance. Sorry for the poor explanation.

1 Like

You can’t run code while servers are offline, but you can use Roblox’s os API to check the date, and store it in a DataStore. Then upon their rejoining, check the DataStore to see if a day has passed.

You’ll want to be using os.date()

2 Likes

You can also try this tutorial: The Tutorial