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

debounce not working, how to put stop a tool from spamming?

Asked by 6 years ago

i have this code that plays and animation when the tool is activated, however the debounce doesnt seem to affect it at all. how do is top the tool from spamming ?

local attack = false
weapon.Activated:connect(function()
    local chop = weapon.FiraAxeChop
    if attack == false then
        attack =true
        game.ReplicatedStorage.RemoteEvents.FireAxeChop:FireServer(chop)
        wait(5)
        attack = false
    end


end)
0
Can you place a print in your conditional? The debounce looks like it would work properly. I would suggest rewriting "attack == false" as "not attack" though. Tomstah 401 — 6y
0
nvm fixed it, turns out i was working on the original models script and not the copy i was using *Face Palm* deerdharok 91 — 6y

Answer this question