Hi guys, i'm running a server and in the process of creating some events. The current one is having NPC's spawn at set locations with custom weapons.So far they don't spawn with the custom weapons (m9k assault rifle) but they do with the HL2 weapons and most importantly, they do not attack players, they just follow them.
I would appreciate any help that can be given.
[CODE]/*
TRILOGY EVENTS DRAFT
*/
/*
Map Positions & Weapon Settings for entities
*/
local spawns = {}
spawns[1] = { position = Vector(823, -209, -79), weapon = "weapon_smg1" }
spawns[2] = { position = Vector(622, -431, -83), weapon = "weapon_ar2" }
/*
Main Function
*/
function EventTest()
timer.Create( "event1", 10, 0, function()
if (#ents.FindByName( "CombineGroup1" ) > 0 ) then return end
for i = 1, #spawns do
local npc = ents.Create("npc_combine_s")
npc:SetName("CombineGroup1")
npc:SetModel("models/csgoprofessional1npc.mdl")
npc:AddRelationship("player D_HT 999")
npc:SetPos(spawns[i].position)
npc:Spawn()
npc:SetHealth(100)
npc:Give(spawns[i].weapon)
npc:Activate()
for k, v in pairs( player.GetAll() )do v:PrintMessage(HUD_PRINTTALK, "A Terrorist Has Appeared!") end
end
end )
end
/*
Run script after entities are loaded
*/
hook.Add( "InitPostEntity", "event1", EventTest )[/CODE]
Sorry, you need to Log In to post a reply to this thread.