local player = game.Players.LocalPlayer game.Players.PlayerAdded:Connect(function(plr) plr.Chatted:Connect(function(msg) local animation = game.StarterPack.LocalScript.Blue local character = plr.Character local hum = character.Humanoid if msg == "/e dab" then local track = hum:LoadAnimation(animation) track:Play() end end) end)
It's because playeradded have some problems being used on the client side. I fixed your script, it should work now. Also, animations are able to work on the local side as the player controls all their movements.
local player = game.Players.LocalPlayer player.Chatted:Connect(function(msg) local animation = game.StarterPack.LocalScript.Blue local character = player.Character local hum = character.Humanoid if msg == "/e dab" then local track = hum:LoadAnimation(animation) track:Play() end end)
First of all, I would like to say that there is no error in your script. Playeradded can sometimes have issues in the client side, but it works if you know how. Also I believe that the chatted event can be used better in a server script. Copy your code onto a script in serverscriptservice and delete the first line: “local player = game.Players.LocalPlayer”. With the player parameter from playeradded event, you should get the character. From there you should be good. Any problems, don’t hesitate to comment back. Also it’s recommended to use animations from client side so you could fire the client and play animation from the client. Thanks!