Animation plays on server side but not cilent side

I searched over youtube for some animation scripts and it works perfectly for them as they see the animation on the cilent side, but as soon as i insert the script it will only play on the server side and not the cilent side. Any solutions?

local animation = script:WaitForChild(“Dance”)–“Dance” is the animation’s name

local humaniod = script.Parent.Parent:WaitForChild(“Humanoid”)

local dance = humaniod:LoadAnimation(animation)

dance:Play()–this makes it play

dance.Looped = true–this makes sure that the animation is looped

–the animation is under the script, you can rename it but you would have to change the script.Put your anim ID where the anim is instead of mine

1 Like

From what I hear Animations are supposed to run on the Client.

  • Is this a local script or server script?
  • Where is this script located?

Also please put 3 backticks (```) before and after your copy/pasted code so we can see the proper formatting.

1 Like

it’s a server script and it’s located inside of a npc i tried putting the script in it’s humanoid and model but yet it didn’t work

local animation = script:WaitForChild("Dance") -- "Dance" is the animation’s name

local animator = script.Parent.Parent.Humanoid:WaitForChild("Animator")

local dance = animator:LoadAnimation(animation)

dance:Play() -- this makes it play

dance.Looped = true --this makes sure that the animation is looped

If you read the link it shows you how to put a server script inside ServerScriptService and how to replace an Animation.

thats mainly talking about a animation on a player not a npc

I replaced the script with this and it seems to be giving the same issue. The NPC will only play the animation on the server side but not for the client side.

I found the solution, the script needs to be a children of the animation.

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