Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
-1

how to make sword script animtion player?

Asked by 6 years ago

i can make a sword animation player i have all animations attack and idle but the script isn't working sword damage works but animation player isn't working

damage script:

script.Parent.blade.Touched:connect(function(p)

if script.Parent.CanDamage.Value == true then

script.Parent.CanDamage.Value = false

p.Parent.Humanoid:TakeDamage(20)

end

end)

animation player isn't working help me here:

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)

Answer this question