Can someone explain what a debounce is and how does it work?
✓ ANSWER ACCEPTED
What is a debounce?
1 answer
✓ Accepted answer
It's basically a variable that prevents an event from going on and on. Here's an example:
Say you want to give a player Money:
debounce = false --true or false, doesn't matter
script.Parent.Touched:connect(function(player) --The brick gets touched and calls the player
if debounce == false then --Checks to see if it is false
debounce = true --Now no one can touch the brick until debounce = false
--Code to give player Money
wait(10) debounce = false --Waits 10 seconds before the brick can give money again.
end
end)
I hope that I've answered your question :D.
This discussion is preserved as it was. New answers, comments, and votes are closed.

2 comments
thanks
No problem. If you need any more help, don't be afraid to ask me on ROBLOX: fahmisack123