I want to make a boost system. I already did it, but when I leave, the timer is still running. For example, I have a 5 minute timer left on the boost, but when I leave and rejoin back, it’s 3 minutes. I want it to be 5 minutes when I rejoin again. I’m using os.time and using datastore.
Script when adding a timer
Data = os.time() + 300
So when the player purchases the boost, calculate the time until the boost will run out which is what you have already done. Then have a loop that goes every frame or second or something until the os time is greater than the boost time.
The reason why is cause your saving the data in a datastore, and using that data (if it’s there), sooo if you leave with 3 minutes left, it will set it as 3 minutes left.
Now of course, this is all an assumption (cause you never really provided any of your code other than an
os.time() snippet…), but remove the data store if you don’t want the data stored.
So I will not save the timer on a datastore?
If you don’t want the boost timer to save, then don’t save it.