New: Nitro Boost our Discord server and receive full donation perks here on the website! Join the Scripting Helpers Discord Server to learn more! You can also Support on Patreon as always.
Ad
Still have questions? Join our Discord server and get real time help.
Log in to vote
1

How do I make a limited click detector?

Asked by 11 months ago
Edited 11 months ago

Please include the code which you are trying to use, so the community will be better-equipped to help you with your problem.
game.Workspace.ControlStationForTruck.Button.ClickDetector.MaxActivationDistance = 0
wait(10)
game.Workspace.ControlStationForTruck.Button.ClickDetector.MaxActivationDistance = 32

Is there a better way to write that?

1 answer

Log in to vote
1
Answered by
Kami_Yo 67
11 months ago

you can just add a wait and a debounce

local debounce = true
script.Parent.MouseButton1Click:Connect(function()

    if debounce then
        debounce = false
        wait(10)
        debounce = true
    end

end)
0
Thanks! bartbpatel 110 — 11mo
0
I'm accepting your answer because I'm not letting this kid just get an answer and not accepting it. DeceptiveCaster 2794 — 11mo
Ad

Answer this question