of     1   

Trubisky
#140970745Sunday, July 20, 2014 7:03 PM GMT

How do i add a debounce to a clickdetector function?
blockoo
#140972358Sunday, July 20, 2014 7:20 PM GMT

Let's say this is your ClickDetector script: function click() --do stuff end ClickDetector.MouseClick:connect(click) Change it to this: debounce = false function click() if debounce == false then debounce = true --do stuff wait(10) debounce = false end end ClickDetector.MouseClick:connect(click) That will add a 10 second debounce.
TakeYourLemons
#140972460Sunday, July 20, 2014 7:21 PM GMT

What pray tell is a debounce? Throw clickdetector object and put in a script for onclicked (examples galore) that changes the velocity of what is impacting player would be my guess.
blockoo
#140972609Sunday, July 20, 2014 7:23 PM GMT

@TakeYourLemons Debounce is an informal term we use around here to describe a method for limiting the amount of times a function can run within a certain period of time.
Frostglacier
#140972626Sunday, July 20, 2014 7:23 PM GMT

@Take A debounce is essentially something in your code that prevents a function from repeating itself over and over, causing unnecessary overlapping and possibly a break in the code.
TakeYourLemons
#140972766Sunday, July 20, 2014 7:24 PM GMT

Never mind found it in the Wiki, and was ninja'd with a much better answer.

    of     1