Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
1

Someone please explain Debounce?

Asked by 10 years ago

Not a clue what it means, thanks!

2 answers

Log in to vote
2
Answered by
1waffle1 2908 Trusted Badge of Merit Moderation Voter Community Moderator
10 years ago

Debounce is to prevent multiple signals from being sent to trigger the same function where there would be a problem if the function was called again before it finished.

Ad
Log in to vote
4
Answered by
Dummiez 360 Moderation Voter
10 years ago

You can found the best detailed guide at the ROBLOX wiki: http://wiki.roblox.com/index.php/Debounce

In my words, it is simply a set in which when you have a event or something, such as a regen button it activates and will stop the regen button from running again until the regen process or time cooldown is done. So for example:

debounce = false

function onTest()
if not debounce then debounce = true
print("This line will only appear once debounce is false")
wait(3)
debounce = false
print("This function can be executed again")
end
end
0
Thanks for the detailed answer! Voted your answer up, 1waffle1 gave a slightly clearer explanation :) Shaydesilva 85 — 10y

Answer this question