Ok, well I'm making an npc shop and I want the npc to stand still, how would I do this? At the moment in init.lua I have this.
[lua]
function ENT:SpawnFunction( ply, tr )
if ( !tr.Hit ) then return end
local SpawnPos = tr.HitPos + tr.HitNormal * 16
local ENT = ents.Create( "npc_citizen" )
ENT:SetPos( SpawnPos )
ENT:Spawn()
ENT:SetHealth(999999999)
ENT:SetUseType(SIMPLE_USE)
ENT:Activate()
return ENT
end
[/lua]
Try ENT:SetKeyValue( "spawnflags", "128" )
Although it appears you're trying to make some sort of interactive NPC, in which case you might look into using a [url=http://wiki.garrysmod.com/?title=Basic_Scripted_NPC]SNPC[/url].
Ok thanks, will it work properly as an entity or not and I can't get anything to happen when it is used, can you "use" an entity?
For something like that you're best of using the SNPCs
Unless you're just creating an entity that stands still and uses the animations from the npc_citizen. That seems kind of simple.
Sorry, you need to Log In to post a reply to this thread.