Idle anim still plays after tool unequipped

So I made a tool where it works as a tool but if I equip the tool then instantly unequip it then the idle animation set for the tool starts playing? this is the code:

script.Parent.Equipped:Connect(function()

if not broken then

Equip:Play()

Equip.Stopped:Wait()

Idle:Play()

equipped = true

else

plr.Character.Humanoid:UnequipTools()

end

end)

script.Parent.Unequipped:Connect(function()

Idle:Stop()

Equip:Stop()

equipped = false

end)

You could just get the running tracks of the Humanoid and stop it, destroy it.

1 Like

Maybe use Humanoid:GetPlayingAnimationTracks() with pairs to stop the idle animation.

how would or can do that? never used getplayingtracks

Animation tracks are loaded animations.

for i, track in pairs(Humanoid:GetPlayingAnimationTracks()) do
	if track.Name == AnimationName then
		track:Stop()
	end
end
1 Like