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

Sound doesn't play with debounce in the script, but works without?

Asked by
Nump4d 5
4 years ago
local handle = script.Parent.Handle
local deb = false


function onActivated()
    if not deb then
        deb = true
        handle.pet4:Play()  
        wait(4)
        deb = false
    end
end

script.Parent.Activated:connect(onActivated)

I really don't know what is wrong with my script, the script works without the debounce, but the debounce is necessary for this tool i am working on.

0
instead of 'if not deb then' try 'if deb == false then' Fad99 286 — 4y
0
this doesn't work i might just redo the script / find another way to add a cooldown Nump4d 5 — 4y

Answer this question