Why doesn’t this work?
[lua] function GM.CreateNPC ( Class, Location, Angles, Model )
for k, v in pairs(ents.FindInSphere(Location, 128)) do
if v:GetModel() == Model then
return false;
end
end
local NewNPC = ents.Create(Class);
NewNPC:SetPos(Location);
NewNPC:SetAngles(Angles);
NewNPC:Spawn();
NewNPC:SetModel(Model);
local Bubble = ents.Create('ent_quest_bubble');
Bubble:SetNetworkedEntity('ChaseEntity', NewNPC);
Bubble:SetPos(NewNPC:GetPos() + Vector(0, 0, 64));
Bubble:Spawn();
return NewNPC, Bubble;
end
function GM.CreateNPCs ( )
local GAMEMODE.CreateNPC('npc_citizen', Vector(-1518.750000, 300.468750, 48.031250), Angle(0, -180, 0), 'models/humans/group01/male_04.mdl');
local GAMEMODE.CreateNPC('npc_citizen', Vector(-1518.750000, 205.875000, 48.031250), Angle(0, -180, 0), 'models/humans/group01/male_04.mdl');
local GAMEMODE.CreateNPC('npc_citizen', Vector(-2175.687500, 153.218750, 228.312500), Angle(0, 90, 0), 'models/humans/group01/male_04.mdl');
local GAMEMODE.CreateNPC('npc_citizen', Vector(-1518.750000, 110.875000, 48.031250), Angle(0, -180, 0), 'models/humans/group01/male_04.mdl');
end
RunConsoleCommand(‘ai_disable’, ‘0’);
RunConsoleCommand(‘ai_disabled’, ‘0’);
timer.Simple(10, RunConsoleCommand, ‘ai_disable’, ‘1’)
timer.Simple(10, RunConsoleCommand, ‘ai_disabled’, ‘1’)[/lua]
(User was banned for this post ("Wrong forum" - mahalis))