Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

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

Asked by
c4ots 12
2 years ago

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

Log in to vote
1
Answered by 2 years ago

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

Ad

Answer this question