I recently made an animation and wanted to make the npc play it. After making the animation I wrote a script and put it in the npc I wrote
script.Parent.ClickDetector.MouseClick:Connect(function(player) local track = script.Parent.Humanoid:LoadAnimation(script.Parent.AnimSaves.TestAnim) track:Play() print("yay") end)
After writing the script I found out that the animation wouldn't play but would print yay. I tried adding track:Stop but it woludn't fix it. How wolud I fix it? Thank you if you answer
That's probably because the animation does not have an ID. To make an animation with an ID, follow these steps:
Animation
instanceAnimationId
value, but keep the number and get rid of the '0' at the last digit of the IDLoadAnimation()
on the animation and now your NPC should do the animation once you run the game!That should be useful for you!
BTW, you used an invalid ID, for example: fe3db201e86f1c9bbd9ffeef322a95e2
. Roblox will read that as an ID that is not on their website, so the animation does nothing.