Ad
Log in to vote
-1

Why is my debounce not working?

Asked by 7 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 193 — 7y
0
Nope raspyjessie 117 — 7y

1 answer

Log in to vote
0
Answered by
lomo0987 250 Moderation Voter
7 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