Animation Not Working

So my animation won’t play in my local script

local stands
local rots 
local heds 
local faces
local torss 
local rarms
local larms
local rlegs 
local llegs 
local donutanim 

if chr:FindFirstChild("StandS") then

	isuser.Value = true


if isuser.Value == true then
	stands = chr:WaitForChild("StandS")
 rots = stands:WaitForChild("StandHumanoidRootPart")
 heds = stands:WaitForChild("Stand Head")
 faces = heds:WaitForChild("face")
 torss = stands:WaitForChild("Stand Torso")
 rarms = stands:WaitForChild("Stand Right Arm")
 larms = stands:WaitForChild("Stand Left Arm")
 rlegs = stands:WaitForChild("Stand Right Leg")
	llegs = stands:WaitForChild("Stand Left Leg")
	donutanim = human:LoadAnimation(stands.StandHumanoidRootPart.Donut)


heres me defining everything. I have more upwards

function strongpunch()
	if activu == true then return end
	if summoned.Value == true then return end

	if strongpunchcooldown == true then return end
	if chr.Disabled2.Value == true then return end

	activu = true
	punchcombo = 1
	strongpunchcooldown = true
	if chr:GetAttribute("Stunned") then return end

	if chr:GetAttribute("Stunned") then
		activu = false
		return end

	fxevent:FireServer("Effect",, .3, .3),, 6, 6),"Institutional white"),hrp.CFrame * CFrame.Angles(math.rad(90), math.rad(0), math.rad(0)) *, -5, -1))
	for _ = 1, 2 do
		hito(rightarm, rightarm.CFrame *, -1, 0) *, 0.25), math.random(-0.25, 0.25), math.random(-0.25, 0.25)) ,5.5, 11, 0.5, 0.25, hrp.CFrame.lookVector * 50,"rbxassetid://281156569",.8,.3,true)
	activu = false

	strongpunchcooldown = false

Heres the error i get

It was working before i changed the way the variables were defined


What is on line 239 exactly? I do not want to count 239 lines


the part for playing the animation

Maybe just do

donutanim:Play() instead of EndStrongSFX:Play(),
Since I can't see the line problems thats my only solution

But that would play sounds instead of animation.

Where did you define donut variable

How would it play a sound?

My bad a read that wrong, I already played it in the script. Thats why im getting that error

Bottom of the first script chunk thing

Is it a typo it says
donutanim = …
but you did donut:Play()

I basically dont know what lines im looking at ngl.
GalaxyRIP324 probably has the same problem.

Bottom of the first line. Thats at the top

1 Like

Where are u even trying to play that animation?

Yes I understand im saying if you did
donutanim:Play() does it fix

My guess is that

if chr:FindFirstChild(“StandS”) then

StandS does not exist in the first milisecond the script is run so therefore the animation would never be loaded

If you want to make sure it exists you might want to try :WaitForChild() instead

1 Like

I’ll try that

thank you for the help

1 Like