Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

What is a debounce?

I've been wondering, what is debounce?

5 comments

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.

1

And, thanks by the way.

0

No problem. :) Also, you don't need to give me a Reputation, I'm just glad to help others. :)

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. :)

1

Alright, I'll post my comment as an Answer, however, I fail to realize why?

2 answers

✓ Accepted answer

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.

1 comment

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'

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!

This discussion is preserved as it was. New answers, comments, and votes are closed.