I made a part that shows gui on touch with the help of @youtubemasterWOW , but I tried to add Debounce to it and its not working. I am pretty sure that I wrote it down right but I didn't get any errors but as I said, it didn't work. can someone help me? here is my code:
local debouce = false
local gui = game.ReplicatedStorage.EasyGUI
local frame = gui.Frame
local function onTouched(hit)
if not debouce then
debouce = true
local player = game.Players:GetPlayerFromCharacter(hit.Parent)
if player then
local clone = gui:Clone()
clone.Parent = player.PlayerGui
wait(1.5)
debouce = false
end
script.Parent.Touched:Connect(onTouched)
end
end
I need help on this a lot so that the players in my game don't find it annoying to keep on pressing to close button on the gui.

4 comments
it works but it still clones multiple GUIs. I am confused. Do you have another solution for this?
Updated
And yes, it makes sense i see now.
Thank you!