@name Kinetic Fury 2
@inputs 
@outputs NPC:array Players:array Tar Sent Check Check1 Check2 XYZ:vector
@persist Tar Sent
@persist Players:array NPC:array Dump:array Sabots:array Target:array
@trigger 
@model models/props_junk/sawblade001a.mdl
if(ops()>4800){exit()}
runOnTick(1)
Home=entity()
if(findPlayerUpdateRate()){
findInSphere(Home:pos(),2000)
findSortByDistance(Home:pos())
findIncludeClass("player")
findIncludeClass("npc")
Dump=findToArray()
Players=array()
NPC=array()
for(C=1,Dump:count()){
Dumped=Dump[C,entity]
if(Dumped:isPlayer()){Players:pushEntity(Dumped)}
if(Dumped:isNPC()){NPC:pushEntity(Dumped)}
}
}
gSetGroup("Kinetic Fury")
Sabots=entity():getConstraints()
runOnChat(1)
K=chatClk()
Chat=entity():owner():lastSaid()
Com="Fury"
PK="PK"
NK="NK"
Sentry="sentry"
Disposable="once"
Com1=Chat:find(Com)
PK1=Chat:find(PK)
NK1=Chat:find(NK)
Sentry1=Chat:find(Sentry)
Disp=Chat:find(Disposable)
Tar=gGetNum("Target")
Sent=gGetNum("Sentry")


if(K&Com1){
if(PK&!NK){Tar=0 gSetNum("Target",0) print("PK Kill On")}
if(NK&!PK){Tar=1 gSetNum("Target",1) print("NK Kill On")}
if(Sentry1){gSetNum("Sentry",1) print("Sentry Mode On")}
if(Disp){gSetNum("Sentry",0) print("Sentry Mode Off")}
}



if(Tar){Target=NPC:clone()}else{Target=Players:clone()}

Speed=20
Check1=(Players:count()&!Tar)
Check2=(NPC:count()&Tar)
Check=Check1|Check2
if(Sabots:count()){
if(Check){
if(!Target[C,entity]:isAlive()){
Target:removeEntity(C)
if(Tar){NPC:removeEntity(C)}else{Players:removeEntity(C)}
}
for(C=1,Sabots:count()){
E=Sabots[C,entity]
XYZ=Target[C,entity]:pos()
Q=Target[C,entity]

E:applyForce((Speed*((XYZ-E:pos())+vec(0,0,Q:height()/2))-E:vel())*E:mass()+Q:vel()*10)
}
}else{
for(C=1,Sabots:count()){
E=Sabots[C,entity]
XYZ=Home:pos()+vec(0,0,E:radius()+5)
E:applyForce(Speed*XYZ-E:pos()-E:vel()*E:mass())
}}}

