I have read this: [url]https://maurits.tv/data/garrysmod/wiki/wiki.garrysmod.com/index7853.html[/url]
and this: [url]https://facepunch.com/showthread.php?t=1215495[/url]
I still don't really understand. I have made a Derma menu already, but I can't seem to figure out how to spawn the NPC.
Brandonj4 said to use this:
local function SpawnEntities()
if SERVER then
local npc = ents.Create("npc_shop")
npc:SetPos(Vector(0,0,0))
npc:SetAngles(Angle(0,0,0))
npc:Spawn()
end
end
hook.Add( "InitPostEntity", "SpawnEntities", SpawnEntities)
It doesn't seem to work for me though, I set the Vector and Angle correctly. And I added it to the init.lua
I just want an NPC that'll open my Dermapanel when I hit (use) when looking at it, can't find an easy way to do this. All information I can find is missing some parts. All finished scripts I look at are so complicated, I just want to run my Derma on the client ;_;
try this? [img]http://wiki.garrysmod.com/favicon.ico[/img] [url=http://wiki.garrysmod.com/page/list/Set]list.Set[/url]
Also make sure you set ENT.Category.
Is your entity named "npc_shop"?
Also, I would recommend you put that in a lua/autorun file and NOT the init of the entity.
Does your NPC actually exist(can be seen in the spawnmenu), or no?
By the way, i think you need to create a model too, just positions wont work.
Probably.
I think.
Shop:SetModel( "whateverfloatsyourgoatl" )
[QUOTE=Padle;49386454]Does your NPC actually exist(can be seen in the spawnmenu), or no?
By the way, i think you need to create a model too, just positions wont work.
Probably.
I think.
Shop:SetModel( "whateverfloatsyourgoatl" )[/QUOTE]
The model gets set already in the ENT:Init(), duh.
Sorry, you need to Log In to post a reply to this thread.