I'm making a game and there is supposed to be an NPC playing a animation, in studio it works perfectly! But ingame it doesnt. Here it is:
a = Instance.new("Animation") a.AnimationId = "https://www.roblox.com/AssetID?=2103144653" ta = nil p = true if p == true then c = script.Parent.Humanoid trackanimation = c:LoadAnimation(a) trackanimation.KeyframeReached:Connect(function(kf) end) trackanimation.Looped = true trackanimation:Play() end
Since it works in studio and not in server it should be a latency problem, this happens because in studio, everything is local so you don't have to wait for a server to create stuff so your local scripts run instantly. In server this doesn't happen.
Make Sure Your Script Is Local one
You can try and add this
repeat wait() until game.Players.LocalPlayer.Character --Add it to the top of the LocalScript
I hope it works for you, good luck.
I was playing with some friends so I tested in studio simulation test. I don't know if studio simulation is like 100% copy of Roblox' original server but it didn't work.