my shower keeps turning off and off after spamming it with 10 clicks
COMMUNITY QUESTION
How do you make it so you cant spam a click detector?
1 answer
You would add a debounce so that there was a cooldown between clicks:
local debounce = true
local cooldown = 5 --change to seconds between clicks
script.Parent.ClickDetector.MouseClick:Connect(function()
if debounce then
debounce = false
--do shower script
wait(cooldown)
debounce = true
end
end)
This discussion is preserved as it was. New answers, comments, and votes are closed.

1 comment
Thanks for spreading to the world how amazing debounces are.