Pointshop NPC Guy

Ive been playing around with some entities on my server and i was wondering how i would go about having an NPC spawned somewhere and when the player used it it would do RunConCommand ps_shop and so on. I looked around for some tutorials and theres nothing. The best i found was this but it doesnt seem to work. Thanks in advance.

Only thing wrong with that is
[lua]self:CapabilitiesAdd( CAP_ANIMATEDFACE | CAP_TURN_HEAD )[/lua]
should be
[lua]self:CapabilitiesAdd( CAP_ANIMATEDFACE, CAP_TURN_HEAD )[/lua]

Every time i try that code i keep getting ENT as nil value and i dont know how to fix it.

Exact error would help… Just sayin bro.

It wouldnt help. Just that ENT in ENT.Initialize is nil… along with the other ents used in the link ^^^

Yes it would help, otherwise he wouldn’t of asked for it. Posting your code would help too. “ENT in ENT.Initialize is nil” sounds like an easily fixable problem of replacing ENT with self.

Seems to be working just fine for me after correcting the issue in my previous post.


[lua]lua_run local shop = ents.Create(“npc_shop”) shop:SetPos(Vector(200, 110, -12223)) shop:Spawn()[/lua]

Fantastic! It works perfectly now. Thanks for the help.