I have a script inside of a NPC and the script contains a Animation as one of its children and the animation plays in studio but not the game.
local char = script.Parent --the npc
local hum = char:WaitForChild("Humanoid")
local animation = hum:LoadAnimation(script.Animation)
if char ~= nil then
animation:Play()
end

4 comments
Is this in a local script?
what is "Animation"? It needs to be an ID
No it doesn't, if you have an actual animation object, then you can load that instead.
Its in a server script