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

How would you make a anti-AutoClicker?

Asked by 5 years ago

I'm currently working on a game that involves clicking, on the clickdetector can I use a anti-autoclicker somehow?

0
debounce User#19328 0 — 5y
0
ClickDetector.MaxActivationDistance = 0 awesomeipod 607 — 5y

1 answer

Log in to vote
0
Answered by 5 years ago
Edited 5 years ago

A very simple solution is to just have a boolean determine if the player is allowed to click again.

local canClick = true -- defaults to letting the player click

Button.MouseButton1Down:Connect(function()
    if canClick then -- check if they can
        canClick = false -- they just clicked, set it to false
        -- do stuff
        canClick = true -- maybe wait before setting it to true if you want
    end
end)

The above example is for a UI button, but the same logic would work with a ClickDetector (the only difference would be the event).

Ad

Answer this question