Use an SNPC

I want to know how to make it where when you use an snpc it runs a concommand, kinda like some rp scripts.

Its easy, just a litle hook. I use it in my lobby alot:



function ENT:AcceptInput( name, activator, caller, data )
	if ( caller:IsPlayer() ) then
//YA CODE GOES HERE!!
	end
end


???, you should seriously start posting in “What do you need help with V1” thread, cause you make 5 threads a day with tiny questions.

is that serverside ?

Yes.

Yep! you could hook it to some usermessages if you wanted it client side?

[editline]05:58PM[/editline]

:ninja’d:

Also how can you get an SNPC to show in the spawn menu?

ENT.Spawnable = true
ENT.AdminSpawnable = true

so its the same for npc’s as sweps?

Yeah but it says ENT not SWEP, at least I think it is.