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

Animation keeps playing after gear gets unequipped. How do i fix that?

Im trying to make it so the animation only plays while the gear is equipped but it keeps playing even after i unequip it, I tried to turn Loop off but then it only plays for 2 seconds (the animation is set to Action). This is the Local Script im using:

wait (2)

local hum = game.Workspace[game.Players.LocalPlayer.Name]:FindFirstChild("Humanoid")

local idle = hum:LoadAnimation(script.Idle)

script.Parent.Equipped:Connect(function()

then idle:Play()

end)

1 answer

✓ Accepted answer

Did you make a script that stops the animation once it is unequipped? If you didn't, then you need to make a script that stops it like this:

script.Parent.Unequipped:Connect(function()
idle:Stop()
end)

This won't affect other players if you put this in the local Script, which I am sure you already know

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