so the problem is that it saves the click so i can click the sword and 30 seconds later touch the humanoid and it takes damage i dont know how to fix it
IsTouching = false CanDamage = script.Parent.CanDamage.Value script.Parent.Activated:connect(function() CanDamage = true script.Parent.blade.Touched:connect(function(p) IsTouching = true if IsTouching == true and CanDamage == true then print("CanDamage has been verified") print("Can Damage has been sent to false") CanDamage = false p.Parent.Humanoid:TakeDamage(20) print("The Player has taken damage") end
end)
script.Parent.blade.TouchEnded:connect(function() IsTouching = false
end)
end)