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

Animation doesn't loop when tool is equipped?

My animation doesn't loop on idle when the tool is equipped. I don't know why because I've set it on the highest priority of Action, but after 2 - 4 seconds it goes back to its default animation after being equipped.

Heres my code:

local tool = script.Parent
local Animations = script.Parent.Animations

tool.Equipped:Connect(function()
	local animation = game.Players.LocalPlayer.Character.Humanoid:LoadAnimation(Animations.SwordIdle)
	animation:Play()
end)



1 answer

✓ Accepted answer

In the animation editor when creating your animation there is a button called "Loop" check that to on and it should loop then when you un equip the tool do animation:Stop()

3 comments

0

Thanks for the help.

0

Now the animation wont stop, any ideas on how to fix that?

0

He said when the player un-equips the tool, do animation:Stop()

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