I made a shop gui and it works and all, but when i tried making the part that opens it when you touch it, it works only one time. After i close it and try to open the gui again, it does nothing. I have no idea why. this is the script of the part to open the gui:
debounce = false
script.Parent.Touched:Connect(function(hit)
local plr = game.Players:GetPlayerFromCharacter(hit.Parent)
if plr and debounce == false then
debounce = true
plr.leaderstats.Coins.Value = 10
plr.PlayerGui.ScreenGui.Shopkeepa.Visible = true
debounce = false
end
end)

3 comments
i will try to fix this even though im a beginner
You need to be waiting before enabling debounce. In between lines 7 and 8, wait(n) where n is how long you want the cool down to be
What if he doesnt want a Cooldown?