Hi. I am trying to set up an NPC floor turret and make it shoot zombies for a mod called Zombie Survival.
I spawned the turret with the following code:
[lua] local turret = ents.Create (“npc_turret_floor”)
for k, humans in pairs (team.GetPlayers (TEAM_HUMAN)) do
for k,zombies in pairs (team.GetPlayers( TEAM_UNDEAD ) ) do
I haven’t worked with NPCs so far, but it’s a non-movable turret. It doesn’t need a path to move on or something like that. I don’t know why this simple command doesn’t do its job right.
NOTE: I spawn the turret after I’ve spawned all the bots.
NOTE#2: Pl = Spawner
NOTE#3: If i erase all the ‘addentityrelationship’ functions, it attacks my teammates, but doesn’t attack zombie players.
- What is wrong with this?
- Is there anything missing? (I don’t know, probably a function that makes him ‘start on’, a spawnflag, etc)