Hello, I am trying to load an animation by script. This is my LocalScript...
local CanAttack = true
script.Parent.Equipped:Connect(function()
local AttackL1 = script.AttackAnimationSwordL1
local IdleL1 = script.IdleL1
IdleL1:Play()
end)
script.Parent.Activated:Connect(function()
local AttackL1 = script.AttackAnimationSwordL1
local IdleL1 = script.IdleL1
if CanAttack == true then
AttackL1:Play()
IdleL1:Stop()
wait(1)
CanAttack = false
AttackL1:Stop()
IdleL1:Play()
CanAttack = true
script.Parent.CanDamage.Value = true
end
end)
For some reason I get this error message and the script doesn't work. This is a scrpit that I found on youtube of 2017 so it might be outdated but I don't think Play() is I need help fixing this scrpit. this is the error message I get
Play is not a valid member of Animation

4 comments
hi, may i know which line does the error belong to?
it is different every time but its the lines where I wrote Value:Play()
Is there any error for AttackL1:Play() ? Because i think the error is with IdleL1:Play().
yes both if I keep the sword out it gives me error of IdleL1:Play() and when I click with the sword I get the AttackL1:Play()