So I have made a sword animation and it is supposed to play when you click. The animation, however, does not play and I am wondering why.
The animations are a child of the local script. I used the animation editor. I made an r15 mesh character. The sword I made was not attached to the dummy while I animated. I tried to do that and it didn't work. When I tried that I did not weld them together.
My character just stands there the dummy still takes the damage. Here is the animation code:
local CanAttack = true
script.Parent.Equipped:Connect(function()
local idle = script.Parent.Parent.Humanoid:LoadAnimation(script.Idle)
local attack = script.Parent.Parent.Humanoid:LoadAnimation(script.Attack)
idle:Play()
end)
script.Parent.Activated:Connect(function()
local idle = script.Parent.Parent.Humanoid:LoadAnimation(script.Idle)
local attack = script.Parent.Parent.Humanoid:LoadAnimation(script.Attack)
if CanAttack == true then
attack:Play()
idle:Stop()
CanAttack = false
wait(1)
attack:Stop()
idle:Play()
CanAttack = true
script.Parent.CanDamage.Value = true
end
end)
Here is the damage code:
script.Parent.Blade.Touched:Connect(function(p)
if script.Parent.CanDamage.Value == true then
script.Parent.CanDamage.Value = false
p.Parent.Humanoid:TakeDamage(10)
end
end)
Comment if you need more info. All help is appreciated! Thanks in advance.

2 comments
Let me test that. Thank you for your response.
It worked! Thank you.