I found this post: Daily reward system not saving time
It basically saves the time when you joined using os.time(), and then the next time you join the game, the code checks if the time it is now minus the time it was when you last left was greater than 24 hours (86400 seconds)
Please search if someone has had your problem before you make a post