So I have a script that opens a gui ontouch, however, if you touch it again after 2 seconds, it opens up another gui and layers up. I need a way to resolve this. Thanks =^)
debounce = true
script.Parent.Touched:connect(function(hit)
local hum = hit.Parent:FindFirstChild("Humanoid")
if hum ~= nil and debounce == true then
debounce = false
local player = game.Players:FindFirstChild(hum.Parent.Name)
local Gui = script.Parent.FrameWork:clone()
Gui.Parent = player.PlayerGui
wait(1)
debounce = true
end
end)

1 comment
Works! Cheers.