Hello, I am currently trying to make a daily reward chest, I would like it to grant you 150 coins upon touch, you would walk onto the yellow pads and it would add to your currency.
Here is the script I have made for the money leaderstats, it all works fine so far I haven’t found any bugs in it.
Here is the reward chest.
I am not a scripter so I have no idea how I would make this, I haven’t seemed to find a tutorial based on what I’m looking for, most have just been GUI’s, if you could share some posts it would be greatly appreciated!
Incase you would like to share a script with me, my discord is, RealTimeChicken#3718
Use DataStore to determine if or when the player has collected a reward. If they were not rewarded within the last 24 hours (check with the Datastore) then you can give them the reward.
Are you client-sidedly checking if the player touches the chest? You can just do this all on the server without the need of events (unless you’re using UI, then it would be acceptable)
Also, this video by @Alvin_Blox could be of some use to you:
You probably don’t want to do this, because it will not save since the server does not see the changes.
Also, this thread is over half a year old, so the OP probably solved the issue already. It’s wise to not reply to a question thread if it hasn’t been active for over 3 or so months.
So there are a lot of ways to make this, I’m using this method:
When the Player Redeems the Chest you add to the current os.time() in how many seconds you want your Player to be able to Redeem the Chest again.
After that you just save the Next Redeem Time and that’s it.
It’s best to handle this server-side. You can create a treasure chest and check for each player the last time since they joined the game from their savedData which will allow you to calculate if a whole day passed or not. You can then add the reward from the chest to the player after they touch the chest and you can fire a remoteEvent to that client and do all the fun gui stuff over there.