npc placing help

I need my npc/entity to spawn or be placed on this vector

-6941.322754, -9302.659180, 136.031250

the name of the npc is: npc_shop

[lua]
hook.Add(“InitPostEntity”,“PlaceShopNPC”,function()
local pos = Vector(-6941.322754,-9302.659180,136.031250)
local angles = Angle(0,0,0)
local npc = ents.Create(“npc_shop”)
npc:SetPos(pos)
npc:SetAngles(angles)
npc:Spawn()
end)
[/lua]

Should work but untested.
You may want to edit the angles.

were would i place that?

init.lua ?

Yup.

You better give some kind of credit to Facepunch Forums to help you make your RP.

Wonder what kind of RP it would be for this server without FP.

It wouldn’t be an RP. It would be sandbox.

No.

[lua]
function SpawnNPCs()
local NPC = ents.Create(“npc_shop”);
NPC:SetPos(Vector((-6941, -9302, 136));
NPC:SetAngles(Angle(0, 0, 0)); – Insert your angle. Take away the stuff that is after the “.”
NPC:Spawn();
end
hook.Add( “InitPostEntity”, “SpawnNPCs”, SpawnNPCs)
[/lua]
100% working. Using this myself all the time.
Stick this in init.lua

I see no problem with his? It’s fine.

He posted the same exact thing I did except removed the pos and angle variables and just plugged them into his arguments instead.

Short: He posted the same thing I did, and said mine was wrong.

how do i add a chat bubble thing over its head now?

Wow I am bad at reading one sec.

[lua]
hook.Add(“InitPostEntity”,“AddNPCThing”,function()
timer.Create(“AddNPCThing”,2,1,function()
for a,b in pairs(ents.GetAll()) do
if (string.find(b:GetClass(),“npc_”) == 1) && b:IsNPC() then
local q = b:GetPos()
local p = ents.Create(“prop_physics”)
p:SetModel(“models/extras/info_speech.mdl”)
p:SetPos(Vector(q.x,q.y,q.z+100))
p:SetMoveType(MOVETYPE_NONE)
p:Spawn()
p:GetPhysicsObject():EnableMotion(false)
end
end
end)
end)
[/lua]

Wont work if your NPC’s move. You need to update them if thats the case.

ever thought of http://wiki.garrysmod.com/?, but i guess “Getting hooks” is stealing Codes to you. :frog: