Script: local animation = script:WaitForChild('Animation') local humanoid = script.Parent:WaitForChild('Humanoid') local dance = humanoid:LoadAnimation(animation) dance:Play()
for some reason the animation isnt playing on my npc please help
First of all, you need an animation ID.
You can't just put in 'animation' and expect it to do something.
Here's what I do, and what you should do as well for this script:
local animation = Instance.new("Animation") --this creates an animation object animation.AnimationId = "rbxassetid://1234567890" --this gives it an id, which is what u were missing local control = script.Parent.Humanoid --this assigns what the animation controller is, and if it is an animation controller (created by instance) or if it's a humanoid control:LoadAnimation(animation):Play() --the controller loads the animation (as created earlier) and plays it --bartbpatel