Hi, I have a sword that works perfectly fine, except it only deals damage on the first hit then stops. I get no errors and I dont know whats wrong with it. Here are the 2 scripts that I have in my sword.
1st script (normal script)
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)
2nd script (local script)
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)

8 comments
holy jesus the indentation and deprecated functions, you clearly took this from a free model
Yes, also that is against the rules, I've also seen this spaghetti code somewhere.
this is a piece of art
Because you never tried. If you gave at least some effort into making your own, then we'd help, if not, then feel free to keep using free models.
I did, I tested a lot of stuff in it and cant find the problem.
If I did, I wouldnt be asking.
-50 rep lol
no need to downvote or circle jerk so much guys lol you could always try to help you know