Recently I have been working on a wait timer that when clicked, will prompt you with a message saying “Thank you for your report, it will be read over.” and they cannot click it until the timer is up. The only problem that I am having is that the when the player resets/loads/rejoins the timer instantly resets and the player can send again. Any and all help is appreciated so thank you in advance
Code:
This is on a local script by the way.
local waitactivated
local players = game:GetService("Players")
local player = players.LocalPlayer
script.Parent.Call.MouseButton1Click:Connect(function()
local waitmessage = script.Parent.WaitTimeAfterCall
waitmessage.Visible = true
local reason = script.Parent.Reason
reason.Visible = false
waitactivated = true
wait(600)
waitmessage.Visible = false
reason.Visible = true
waitactivated = false
end)
Let’s say you activate this feature at 1pm and then after 10 minutes you can use this feature again, you still have to save it if you leave the game. And for that you just use the os library
Ah, your edit made it more clear. But yes, @NackerExostylx, using DataStoreService (and the os.time() method) could help you achieve persistence between different sessions.
Yeah, as:
You could also save the seconds that are left before you can use the feature again would be an option, but if you want to work correctly with time you should use the os library. This is useful when creating a login awarding system and much more. With the os library you can work decently with time, easily said.