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

Why won't this debounce work?

Asked by 10 years ago

This debounce below doesn't work for some reason. Anyone know why?

local gui = script.Parent



local chr = gui.Parent.Parent.Parent.Parent.Character
local face = gui:WaitForChild("Skeptic")


local click1 = true

gui.MouseButton1Down:connect(function()
    if chr and face and click1 then
        click1 = false
        local head = chr:FindFirstChild("Head")
        local faceclone = face:clone()
        faceclone.Parent = head
        click1 = true
    end
end)

Plz Help thx

1 answer

Log in to vote
-2
Answered by 10 years ago

You have no wait() in your script, so you're basically making "click1" false and then true at the same same, making it be true every time the script plays.

0
it still didnt work :/ 951753lolguy 2 — 10y
Ad

Answer this question