local animation = Instance.new("Animation") animation.AnimationId = "http://www.roblox.com/Asset?ID=241586474" local animController = script.Parent.AnimationController if script.Parent.Humanoid.Health <= 50 then local animTrack = animController:LoadAnimation(animation) animTrack:Play() end
This is the script I have so far, I know how to add animations into the player but not NPCs and this script isnt working for me. I dont know if its the script thats the problem on the children of the npc. The script is a child of the NPC I also have an AnimationController and a HumanoidRootpart.
please help meh.
Heres a good video about all of this...
https://www.youtube.com/watch?v=aFJADlSyRrQ
I hope that helped. PeasPod is good with Roblox scripting tutorials...
A list of things you want to make sure of when creating an NPC with Animations:
There is a humanoid (And check if there's an Animator inside the humanoid, I'm not sure if that changes anything)
The Animations are loaded into the humanoid (If it still doesn't work after referring to this, load the animations to the Animator in the Humanoid)
In the Torso, there are 5 Motor6Ds. Left Hip, Left Shoulder, Neck, Right Hip, and Right Shoulder. - You may have this one wrong.
There is a humanoidRootPart.
The Animation you are playing is owned by you.
The Animation you are playing isn't being overrun by another animation (This refers to the priority)