I am trying to spawn a non-player object (I have tried both npc_citizen and prop_physics), and the goal is to force it into an animation. For my specific purposes, I need the object (which happens to be a player/npc model) to enter the "sitchair1" animation (which I know the model in question has).
How can I spawn an object of type (NPC/prop_physics), adorned with a player/NPC model, and forced into an animation? Here is a code snippet of what I am currently trying to use. It may be useful to note that, no matter what I do, the NPC (when I tried this with entity type: npc_citizen), just stands around instead of entering an animation.
local npcModel = ents.Create("npc_citizen")
local sit = npcModel:LookupSequence("sitchair1") or npcModel:LookupSequence("headcrabbed");
if ( sit == nil or sit <= 0 ) then print("Didn't find animation"); else print("Found animation!"); end
npcModel:SetSequence( sit );
Thank you for your time, I appreciate any suggestions!