SNPC legs spazzing

So, when my SNPC spawns, its legs are spazzing.

Heres a pic:

http://img121.imageshack.us/img121/214/glitch.jpg

I am spawning it through lua:

[lua]
local function SpawnHatLady()
if SERVER then
local hatlady = ents.Create( “snpc_hatlady” )
hatlady:SetPos( Vector(-2877.906250,-2080.531250,-131.968750) )
hatlady:SetAngles( Angle(2.975509,0.964840,0.000000) )
hatlady:Spawn()
print(“It works”)
end
end
hook.Add( “InitPostEntity”, “SpawnHatLady”, SpawnHatLady )
[/lua]

And my SNPC is…

cl_init.lua
[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 hatMenu = vgui.Create(“DFrame”)
hatMenu.Paint = function()
draw.RoundedBox(0,0,0,hatMenu:GetWide(),hatMenu:GetTall(),Color(0,0,0,210))
surface.SetDrawColor(255,255,50,200)
surface.DrawOutlinedRect(0,0,hatMenu:GetWide(),hatMenu:GetTall())
end
hatMenu:SetDraggable(false)
hatMenu:SetTitle(“Hat Store”)
hatMenu:SetSize(ScrW() - 100,ScrH() - 100)
hatMenu:SetPos(10,10)
hatMenu:MakePopup()
end
[/lua]
init.lua
[lua]AddCSLuaFile( “cl_init.lua” )
AddCSLuaFile( “shared.lua” )

include(‘shared.lua’)

function ENT:Initialize()
self:SetUseType(SIMPLE_USE)

self:SetModel( "models/Humans/Group01/Female_02.mdl" )

self:SetHullType( HULL_HUMAN );
self:SetHullSizeNormal();

self:SetSolid( SOLID_BBOX ) 
self:SetMoveType( MOVETYPE_STEP )
self:CapabilitiesAdd( CAP_MOVE_GROUND | CAP_ANIMATEDFACE | CAP_TURN_HEAD)

self:SetMaxYawSpeed( 5000 )

//don't touch stuff above here
self:SetHealth(10000000000)
self:SetSequence(204)

end

function ENT:OnTakeDamage(dmg)
return false
end
[/lua]
shared.lua
[lua]
ENT.Base = “base_ai”
ENT.Type = “ai”

ENT.PrintName = “Hat Lady”
ENT.Author = “Helix Alioth”
ENT.Contact = “helix@colzdragon.com” //fill in these if you want it to be in the spawn menu
ENT.Purpose = “Colzdragon”
ENT.Instructions = “”

ENT.AutomaticFrameAdvance = true

VoiceListM = {
Sound(“vo/npc/female01/question19.wav”),
Sound(“vo/npc/female01/answer33.wav”),
Sound(“vo/npc/female01/getgoingsoon.wav”),
Sound(“vo/npc/female01/question16.wav”),
Sound(“vo/npc/female01/question15.wav”),
}

function ENT:Use( ply, caller )
self:EmitSound(table.Random(VoiceListM))
ply:SendLua(“Menu()”)
end

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

I would love it if someone could make this SNPC just stand normally. :slight_smile: Help would be appreciated. :slight_smile:

The position of the NPC is too low. Set the Z value higher and she should stand normally.

If their feet are in the floor or inside something it makes their legs spazz about (know from experience on that one. x3)

It’s just like Emz said, an easy way to have her spawn at ground level is to spawn her in the air and add this to her initialize (or the spawning hook) .


self:DropToFloor()

To prove this, just take any human npc, place a prop under them, and move the prop upwards. Their legs will try to move to stand on the object, but their Z position will never move.

She’s just trying to be comfortable =[

Thanks :smiley: