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

What is a debounce?

Asked by 9 years ago

I've been wondering, what is debounce?

5
That Question has been Answered by the ROBLOX Wiki. http://wiki.roblox.com/index.php?title=Debounce It's something that prevents a function from firing multiple times on execution basically. TheeDeathCaster 2368 — 9y
1
And, thanks by the way. Grenaderade 525 — 9y
0
No problem. :) Also, you don't need to give me a Reputation, I'm just glad to help others. :) TheeDeathCaster 2368 — 9y
1
At least post it as an answer so other users who are new to the site can find it with ease and obtain the proper help they need. :) DigitalVeer 1473 — 9y
1
Alright, I'll post my comment as an Answer, however, I fail to realize why? TheeDeathCaster 2368 — 9y

2 answers

Log in to vote
4
Answered by 9 years ago

That Question has been Answered by the ROBLOX Wiki. Debounce is something that prevents a function from firing multiple times on execution basically.

I have posted my Comment as an Answer because I was asked to do so, however, I fail to realize why I have to put it as an Answer.

0
If anyone looks up this question, and comes across this page; That person may not actually read the comments. Most people notice an 'Answer' over a 'Comment' DigitalVeer 1473 — 9y
Ad
Log in to vote
2
Answered by 9 years ago

Debounce will prevent a function from firing rapidly.

Let me give you an example of debounce:

debounce = false --It can be named anything.
game.Workspace.SomeRandomPart.Touched:connect(function()
if debounce == true then return end -- Ends function if debounce is true.
print("This script includes debounce. Did you know that?")
wait(2) -- How long until you are allowed to fire this function again
end
end)

Please upvote and accept my answer if it helped!

Answer this question