Animation not stopping

I have this script to play an idle animation when the tool is equipped, however I can’t get it to stop playing when it is unequipped.

script.Parent.Equipped:Connect(function()
	game.Players.LocalPlayer.Character.Humanoid.Animator:LoadAnimation(script.Parent.Anims.Idle):Play()
end)

script.Parent.Unequipped:Connect(function()
	game.Players.LocalPlayer.Character.Humanoid.Animator:LoadAnimation(script.Parent.Anims.Idle):Stop()
end)

I found a solution. I think it was because I was getting the animation 2 different times.

1 Like