NPC stance is weird

Hey, my NPC’s stance is really weird. When I go to my gamemode, this is what my NPC looks like:

http://img94.imageshack.us/img94/9576/npcproblemk.jpg

Anyone know how to fix this so she looks like a normal person? If you need my codes for my NPC, just tell me.

Bump. Posted almost one day ago.

I think I know, can I see the code? The enumerations may be wrong (Though that may only be for SWEPS…)

I got this code from someone:
[lua]NPC:SetSequence(“idle”)[/lua]

Anyone know where this goes? I looked it up, and it goes in shared, but I don’t know where.

Hmm…I’ve never gotten an NPC to work, but I would guess in it’s own hook? Test it and see, there’s a good chance I’m wrong.

It’s not a hook. I checked on GMod Wiki.

A function, then? It may just be a command that runs on its own, and isn’t a parameter of another command. Just place it somewhere in your code, and end it with an “end”, and see if that works. I’m very unfamiliar with my lua vocabulary, I’m attempting to learn, though!

Is this a custom SNPC or an npc_citizen?

Either way, take a look at this page: **[Entity.SetSequence

http://wiki.garrysmod.com/favicon.ico](http://wiki.garrysmod.com/?title=Entity.SetSequence)**

That’s where I first looked. I don’t understand where to put it, though. And it is a custom SNPC.

Put that anywhere in the code, and end it with an “end” is what I’m guessing…

You can fix it using one of these cvars:
ai_disable / ai_disabled (I don’t recall which one it is off-hand.)

Can you give the entire code of your scripted NPC?

Init:

[lua]AddCSLuaFile( “cl_init.lua” )
AddCSLuaFile( “shared.lua” )

include(‘shared.lua’)
function ENT:SpawnFunction( ply, tr )

if ( !tr.Hit ) then return end

local SpawnPos = (tr.HitPos + tr.HitNormal * 16) 

local ent = ents.Create( "ai_jpcai_clothing" )
ent:SetPos( SpawnPos )
ent:Spawn()
ent:Activate()

return ent

end[/lua]

cl_init:
[lua]include(‘shared.lua’)

ENT.RenderGroup = RENDERGROUP_BOTH

function ENT:Draw()
self.Entity:DrawModel()
end

function ENT:DrawTranslucent()
self:Draw()
end

function ENT:SetRagdollBones( bIn )
self.m_bRagdollSetup = bIn
end

function Menu()
local menu = vgui.Create( “DFrame” )
menu:SetSize( 400, 500 )
menu:Center()
menu:SetTitle( “Testing NPC” )
menu:SetDraggable( false )
menu:ShowCloseButton( true )
menu:MakePopup()

local close = vgui.Create( "DButton", menu )

close:SetSize( 400, 20 )
close:SetText( “Close” )
close:SetPos( 0, 20 )
close.DoClick = function()
menu:Close()
end
end[/lua]

shared:
[lua]
ENT.Base = “base_ai”
ENT.Type = “ai”

ENT.PrintName = “Test NPC”
ENT.Author = “wakeboarderCWB”
ENT.Contact = “N/A” //fill in these if you want it to be in the spawn menu
ENT.Purpose = “N/A”
ENT.Instructions = “N/A”

ENT.AutomaticFrameAdvance = true

function ENT:AcceptInput(input, entActivator, entCaller, data)
if string.lower(input) == “use” then
self:Use(entActivator,entCaller)
return
end
end

function ENT:AcceptInput( input, activator, caller )
if not timerforbox then
timerforbox = true timer.Simple(1, function() timerforbox = false end)
if input == “Use” && activator:IsPlayer() then
caller:SendLua( “Menu()” )
end
end
end[/lua]

Here’s the code to a working SNPC I posted a while ago :
http://www.facepunch.com/showpost.php?p=21490377&postcount=2

Take that and adapt it to your needs (use the skeleton init.lua, the other one is an example).

(I know its an old thread, but…)

Where do you put those files Crazy? I have a copy-paste gamemode I’m making, using copypaste code to see if I can get it WORKING. Then I have a little test gamemmode that I’m doing from scratch from what I’ve learned.

I have in my gamemode file cl_init.lua, init.lua, and shared.lua

For the Npc, would I make a new folder in the gamemode folder? I thought it would just be a “weapon_npc.lua” or something. Or woudl I edit my gamemodes cl_init.lua, init.lua, and shared.lua?

Right now I just want my npc to appear in my Copypaste gamemode, and USE to do anything. If it just opens a menu, or says “Hi” in console… Or anything. I just want my USE input to do something.