If you scroll down and look for the unequipped function, that's the part that doesn't work. When I unequip my tool the idle and run animations should stop, but they still play.
Heres a short video of me unequipping it, idk how to use gyazo that well https://gyazo.com/104197d47e30d4cc1c155023619c7dd8
--Variables humanoid = script.Parent.Parent.Humanoid Running = script.Parent.Running Idle = script.Parent.Idle Attack = script.Parent.Attack --Loads animations runAnim = humanoid:LoadAnimation(Running) idleAnim = humanoid:LoadAnimation(Idle) attackAnim = humanoid:LoadAnimation(Attack) --Animation locations lookForIdle = script.Parent.Idle lookForRun = script.Parent.Running lookForAttack = script.Parent.Attack script.Parent.Equipped:Connect(function() -- basically works fine humanoid.Running:Connect(function(speed) if speed >1 then idleAnim:Stop() runAnim:Play() else idleAnim:Play() runAnim:Stop() end end) end) script.Parent.Unequipped:Connect(function() -- doesn't stop my tool animations when unequipped, Error, "Stop is not a valid member of Animation" lookForIdle:Stop() lookForRun:Stop() end) local debounce = false script.Parent.Activated:Connect(function() -- Attack, pauses character and plays animation when activated if not debounce then debounce = true humanoid.WalkSpeed = 0 attackAnim:Play() wait(2.5) humanoid.WalkSpeed = 16 debounce = false end end)
The problem is that when you're telling the animation to stop, you are tell the actual animation object and not the animation loaded in a humanoid. It should be fixed below.
also sorry I replied late.
--Variables humanoid = script.Parent.Parent.Humanoid Running = script.Parent.Running Idle = script.Parent.Idle Attack = script.Parent.Attack --Loads animations runAnim = humanoid:LoadAnimation(Running) idleAnim = humanoid:LoadAnimation(Idle) attackAnim = humanoid:LoadAnimation(Attack) --Animation locations lookForIdle = script.Parent.Idle lookForRun = script.Parent.Running lookForAttack = script.Parent.Attack script.Parent.Equipped:Connect(function() -- basically works fine humanoid.Running:Connect(function(speed) if speed >1 then idleAnim:Stop() runAnim:Play() else idleAnim:Play() runAnim:Stop() end end) end) script.Parent.Unequipped:Connect(function() -- doesn't stop my tool animations when unequipped, Error, "Stop is not a valid member of Animation" idleAnim:Stop() runAnim:Stop() end) local debounce = false script.Parent.Activated:Connect(function() -- Attack, pauses character and plays animation when activated if not debounce then debounce = true humanoid.WalkSpeed = 0 attackAnim:Play() wait(2.5) humanoid.WalkSpeed = 16 debounce = false end end)