This animation has been put into an NPC, like it says in the title it works perfectly fine in studio but it doesn't work in game but no errors are given.

repeat wait() until script.Parent

IdleAnim = Instance.new("Animation")
IdleAnim.AnimationId = "http://www.roblox.com/asset/?id=366323660"
animTrack1 = script.Parent.Humanoid:LoadAnimation(IdleAnim)
animTrack1:Play()

This is all of the script,

Thanks for the help.