Idle animation not working

Hello everybody! I am quite new to Devforum but I have made an idle animation. But it seems that the script I made only makes the idle animation start for a while, and then the animation doesn’t loop. Here’s the script.

local Tool = nil

local animScript = nil

script.Parent.Equipped:Connect(function()

Tool = script.Parent

animScript = Tool.Parent:WaitForChild("Animate")

animScript:WaitForChild("toolnone"):WaitForChild("ToolNoneAnim")

animScript.toolnone.ToolNoneAnim.AnimationId = "https://roblox.com/asset/?id=9157492617"

end)

script.Parent.Equipped:Connect(function()

Tool = script.Parent

animScript:WaitForChild("toolnone"):WaitForChild("ToolNoneAnim")

animScript.toolnone.ToolNoneAnim.AnimationId = "https://roblox.com/asset/?id=9157492617"

end)

This end should be at the end of the function

maybe try something like

local tool
local animScript
--------
tool = script.Parent
--------
--Equip tool function

tool.Equipped:Connect(function() 
   animScript = tool.Parent.Animate
   animscript.ToolId = --id
end)

this is just example code and it wont run if you just copy and paste this into the script. it should give you the basic idea! hope this helps

alright thanks i’ll try it out.

Pretty sure the animation isn’t looped itself, reupload the animation and set looped to true in animation editor and overwrite.

Phew it worked. Thanks alot man!

1 Like