Hi, I have a sword with two scripts, and the sword only deals damage on the first hit. It gives no errors, and I cant find out whats wrong with it.
script.Parent.Blade.Touched:connect(function(p) if script.Parent.CanDamage.Value == true then script.Parent.CanDamage.Value = false if p.parent.Zombie then p.Parent.Zombie:TakeDamage (script.Parent.Damage.Value) end else end end)
local CanAttack = true script.Parent.Activated:connect(function() local attack = script.Parent.Parent.Humanoid:LoadAnimation(script.Attack) if CanAttack == true then attack:Play() CanAttack = false wait(1) attack:Stop() CanAttack = true script.Parent.CanDamage.Value = true end end)
I have everything inside the sword and it doesn't work, does anyone see any problems?