Thanks to Subsz for solving it!

Hi, so in my game, there's an NPC. He walks to a part and because he just drags, I had to put in an animation that plays. Everything works splendidly until he gets to the part. When he gets to the part, the animation doesn't stop. He's pretty much walking in place at this point. I've tried everything! :Destroy(), :Pause(), but nothing works... it's driving me crazy, so please help me! Script:

game.ReplicatedStorage.TheNextTalk.OnServerEvent:Connect(function(plr)

local animation = script:WaitForChild('Animation')
local humanoid = script.Parent:WaitForChild('Humanoid')
local dance = humanoid:LoadAnimation(animation)
	dance:Play()
	
	wait(5)
	script.Animation:Stop()
	dance:Stop()
	script.Animation:AdjustSpeed(0) 
	dance:AdjustSpeed(0)
	    script.Animation.Looped = false
		script.Animation:Stop(1)
	    dance.Looped = false
		dance:Stop(1)
	
	end)

Please help me! Thank you!

7 comments

0

Any errors in the output?

0

@Subsz, hi. No, I don't believe so.

0

try removing the script.Animation:Stop(),script.Animation:AdjustSpeed(0), and basically anything ur doing with the script.Animation after the wait(5)

0

@Subsz, What do I add instead?

1

Don't, just do dance:Stop()

0

@Subsz, that worked, thank you so much!

1

Np, mark it as solved though.