I have been rlly having a hard time with animations in my NPCs. I'm trying to make them play an idle animation and when I finally thought I had got it to work I realized only the first player to join the server could see them and for the rest of the people they would be standing still.. Here's the code. If anybody knows a better way could u help me?

wait (10)
humanoid = script.Parent:WaitForChild("Humanoid")
anim = Instance.new("Animation")
anim.AnimationId = "http://www.roblox.com/asset/?id=449838324"

Idle = nil

while not Idle do
Idle = humanoid:LoadAnimation(anim)
wait()
end

wait()

Idle:Play()