ID:178413
 
How would i make a turret that fires on mobs in view of 10 and only on mobs when their team var is = 0
ShadowSiientx wrote:
How would i make a turret that fires on mobs in view of 10 and only on mobs when their team var is = 0

Like this:
proc/TargetCheck()
var/list/L=list()
for(var/mob/M in view(10,src)) if(M.team!=team) L+=M
if(L.len) FireAt(pick(L))

This will fire at a random target within the 10-turf view range. Valid targets are any mobs not on the same team as the turret.

Lummox JR