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

How do I add a delay before you can click again in a textbutton?

Asked by
Iclz 2
7 years ago

So currently if you turn on an auto clicker on a textbutton there is no delay (or very small) between the clicks. How do I make it so there is a 1-second delay?

0
You could add a debounce and set it to false when clicked, wait(1) and back to true so it can be clickable again oSyM8V3N 429 — 7y

1 answer

Log in to vote
0
Answered by
lucided 15
7 years ago
Edited 7 years ago

You can add a variable debounce.

Example

debounce = false
TextLabel.MouseButton1Click:Connect(function()
    if debounce then return end
    --code here
    debounce = true
    wait(1)
end)

gah. i think this works edit: last code was for a clickdetector, i'm blind.

0
oops didn't see the textlabel bit lucided 15 — 7y
0
Thanks this helped alot! Iclz 2 — 7y
Ad

Answer this question