How to make idle animation stop when tool is unequiped?
I'm making a pickaxe for my game and I want to have a idle animation that plays when the player has it equipped but i want it to stop playing when they unequip the tool. The animation plays when I equip the tool but when I unequip it the idle animation still plays and i cant get it to stop unless I reset my character. This is the script in the tool responsible for playing the idle animation. It is a local script
01 | script.Parent.Equipped:connect( function () |
02 | local idle = script.Parent.Parent.Humanoid:LoadAnimation(script.Idle) |
07 | script.Parent.Unequipped:connect( function () |
08 | local idle = script.Parent.Parent.Humanoid:LoadAnimation(script.Idle) |
I have also tried
1 | script.Parent.Unequipped:connect( function () |
2 | local idle = script.Parent.Parent.Humanoid:LoadAnimation(script.Idle) |
but neither works for me and I don't see what I'm doing wrong.