@name Fast Zombie Spawner
@inputs D
@outputs Count Stop Wait Feelings:string P1ID Spawn:vector Z
@persist Count Stop Wait P1:entity C Zombies:array
interval(500)
findInSphere(entity():pos(),10000)
findIncludeClass("npc")
Total=findToArray()
if(ops()>500){exit()}
Max = 25
if (Total:count()<(Max*2)) {
D = random(0,360)
R = random(20,500)
if(first()){Zombies=array()}

Spawn = entity():pos()-vec(R*cos(D),R*sin(D),Z*2)


if(Count<=Max&!Stop&Spawn:isInWorld()){ 
P1 = npcSpawn("npc_fastzombie",Spawn)
#Zombies:pushEntity(P1)
P1ID=P1:id()

#entity(P1ID):npcRelationship("player","fear",99)
#Feelings = entity(P1ID):npcDisp(entity():owner())}

#findInSphere(entity():pos(),10000)
#findSortByDistance(entity():pos())
#findIncludeClass("player")
#Player=findToArray()
#if(Player){
##for(C=1,Zombies:count()){
#if(C<=Zombies:count()){
#if(!Zombies[C,entity]){Zombies:removeEntity(C)}
#Zombies[C,entity]:npcGoRun(Player[1,entity]:pos())
#}
#}
if (Count>Max) {Stop = 1 Wait = 0 Count=20}
if (!Stop) {Count+=1}
if (Stop) {Wait+=1}
if (Stop & Wait>90) {Stop = 0 Count = 0}
}
}
if(lastSaid():find("no zombies")){selfDestruct()}





