So I grabbed the animations script that was locally inside of the player when you join a game, and I just made a new server script and inserted into a NPC I made, but this one error keeps coming up in the output but the whole thing is working fine.
This is the line of code that is erroring.
-- setup emote chat hook
game:GetService("Players").LocalPlayer.Chatted:connect(function(msg)
local emote = ""
if msg == "/e dance" then
emote = dances[math.random(1, #dances)]
elseif (string.sub(msg, 1, 3) == "/e ") then
emote = string.sub(msg, 4)
elseif (string.sub(msg, 1, 7) == "/emote ") then
emote = string.sub(msg, 8)
end
if (pose == "Standing" and emoteNames[emote] ~= nil) then
playAnimation(emote, 0.1, Humanoid)
end
end)
Alright, I am just making the NPC have all the animations a regular player would have, didnt want to have to rewrite code that has already been implemented in the animate script