local debounce = false
local debounce2 = false
local toolNoning = humanoid:LoadAnimation(toolNoneAnim)
function attack(hit)
if hit and hit.Parent then
local enemy = hit.Parent:FindFirstChild("Humanoid")
if enemy then
if enemy:IsA("Humanoid") and hit.Parent.Name ~= sp.Name then
debounce = true
while debounce do
toolNoning:Play()
print "wait"
wait(3)
torso.TouchEnded:connect(function(hit2)
if hit2 == hit then
debounce = false
end
end)
end
end
else
if hit.CanCollide then
humanoid.Jump = true
end
end
end
end
Game tends to crash if many humanoid parts (such as a gun held by a humanoid with many parts) collide with it, but I'm fairly sure the debounce mechanism is supposed to stop that....

3 comments
So call"torso.TouchEnded:connect(function(hit2)" outside the while loop?
btw, fan of your Laser Tanks game.
Thank you so much!