Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

Why does this animation not stop?

I'm trying to get an animation to play when you equip the tool. It works fine at first, but you're stuck in the animation afterwards. Here's the code:

script.Parent.Equipped:connect(function(m)
		hum = game.Players.LocalPlayer.Character.Humanoid
		anim_feet = hum:LoadAnimation(script.Parent.Hold)
		current = anim_feet
		current:Play()
end)

script.Parent.Unequipped:connect(function(m)
    current:Stop(0)
end)

1 answer

✓ Accepted answer

Try adding

for _,v in pairs(P.Character.Humanoid:GetPlayingAnimationTracks()) do v:Stop(0.4) end

After line 2.

1 comment

0

Thanks - it worked. I had to replace the "current:Stop(0)" part instead of line 2, but after that it was all good.

This discussion is preserved as it was. New answers, comments, and votes are closed.