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

How do I make a limited click detector?

Asked by 5 years ago
Edited 5 years ago

Please include the code which you are trying to use, so the community will be better-equipped to help you with your problem.
1game.Workspace.ControlStationForTruck.Button.ClickDetector.MaxActivationDistance = 0
2wait(10)
3game.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 72
5 years ago

you can just add a wait and a debounce

01local debounce = true
02script.Parent.MouseButton1Click:Connect(function()
03 
04    if debounce then
05        debounce = false
06        wait(10)
07        debounce = true
08    end
09 
10end)
0
Thanks! sean_thecoolman 189 — 5y
0
I'm accepting your answer because I'm not letting this kid just get an answer and not accepting it. DeceptiveCaster 3761 — 5y
Ad

Answer this question