Problem with tool animation

so i have ran into a problem while trying to add an animation to a tool,
the animation only plays 1 time when it should be looped?
i have tried putting the animationpriority to action4 and it still only plays once. also the funny thing is i have the same script on other tools and the animation is looped
heres the script


local tool = script.Parent
local anim = Instance.new("Animation")
anim.AnimationId = "http://www.roblox.com/Asset?ID=13567513038"
local track


		script.Parent.Equipped:Connect(function()
			track = script.Parent.Parent.Humanoid:LoadAnimation(anim)
			track.Priority = Enum.AnimationPriority.Action
			track.Looped = true
			track:Play()
		end)
		script.Parent.Unequipped:Connect(function()
				track:Stop()
		end)

help would be nice

Hello!

It must be something outside from the code, since when I just copied over it worked perfectly fine. When the code is inside a Server-side Script, it might be because the animation isn’t pre-defined as looping.
I don’t know if this helps, but I will just throw it in here.

To activate it, you just have to go inside the animation editor, import the Animation and toggle it like here:

animation_editor

Then just overwrite the Animation. This way, it isn’t required anymore to toggle it manually inside code,
but it can be toggled off there when necessary.

I hope I could help!

hey thanks for the reply, it seems like the animation didnt become looped when i uploaded it now it works!! thanks

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.