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

Why is my debounce not working?

Asked by 10 years ago

local catbounce = false

function clicker() if not catbounce then

    catbounce = true

        copy1 = Instance.new("ClickDetector",workspace.button1)
            copy2 = Instance.new("ClickDetector",workspace.button2)
            copy3 = Instance.new("ClickDetector",workspace.button3)
        copy4 = Instance.new("ClickDetector",workspace.button4)
            print("thingy gone")

    catbounce = false

end
    end
workspace.path1.Touched:connect(clicker)
0
Any errors in output? yurhomi10 192 — 10y
0
Nope raspyjessie 117 — 10y

1 answer

Log in to vote
0
Answered by
lomo0987 250 Moderation Voter
10 years ago

I believe you need this..

    catbounce = true

if catbounce == true then
        copy1 = Instance.new("ClickDetector",workspace.button1)
            copy2 = Instance.new("ClickDetector",workspace.button2)
            copy3 = Instance.new("ClickDetector",workspace.button3)
        copy4 = Instance.new("ClickDetector",workspace.button4)
            print("thingy gone")

    catbounce = false

end
    end
workspace.path1.Touched:connect(clicker)

Ad

Answer this question