So what I want to do is that a player can only go through a door every 24 hours after the last time they went through the door. But if the player is a new player, then they are allowed to go inside before you need to wait 24 hours. The only thing that I know how to do this is by using wait(). The only problem is that I want it so that even if you leave the game, the time is still counting until 24 hours has pass. Can someone help me? Thank you so much!
Btw you can just make the CanCollide = false after 24 hours.

2 comments
hey can you please teach me and elaborate on how you do it. Im guessing you have to store a data of a player's current time and their previous time using datastore?
I just revised my answer to include sample code. OldTime should equal a ray stored in DataStorage. I'm not familiar with DataStorage, so you will probably have to watch a video on this.