Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

Is there an easy way to make a login rewards system?

I want to give players a certain amount of points or in-game money in my game every day as a login reward, possibly in a tiered system where the more consecutive days they login, the more they get.

My only idea is to create a timer that counts down a whole 24 hours, but I have no idea how I'd make that continue to tick away even if they leave the game. Is that even possible? And even if it is, is it really the most efficient way to do it?

I don't really have any concrete code, and I'm not really asking for any either; just a solid direction to go in, or a very basic example.

1 answer

✓ Accepted answer

You can use tick() to get the time passed since 1970. This is useful, as you can save the time at the time they leave using DataStore. When they rejoin, you can load this time and check if 24 hours (86400 seconds) or more passed by the time of their last join. Now, you may also want to implement that if they are a day late, the system will reset- simply check for 48 hours or more passing. As you can see, it is a useful function.

You can save the number of times the daily login has gone on, too, by saving a number- and adding to it every time they join and pass the check (make sure to keep it in the server).

I hope this helped you!

This discussion is preserved as it was. New answers, comments, and votes are closed.