Hello,
I am working on a gui based game. I want a gui button to have a cooldown after being pressed.
Here is what I tried (you can ignore most of it, I'm just concerned about the debounce).
function clicked(plr)
debounce = true
if debounce == true then
debounce = false
local player = game.Players.LocalPlayer
local edulvl = player.Education.Value
local x = game.ReplicatedStorage.Work:InvokeServer(edulvl)
local y = text(edulvl)
script.Parent.Parent.Parent.Status.Visible = true
script.Parent.Parent.Parent.Status.TextLabel.Text = (y.." "..x.." dollars")
wait(5)
script.Parent.Parent.Parent.Status.Visible = false
debounce = true
end
end
I thought I had my debounce set up correctly, but it doesn't seem to work.
Help would be appreciated

1 comment
Thank you for your response