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)

2 comments

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.

0

nvm fixed it, turns out i was working on the original models script and not the copy i was using Face Palm