@name TestE2
@outputs E:entity Props:array Prop:entity T Bang Ang:angle
@trigger all


if(first() | duped()){
E = entity()
runOnTick(1)
propSpawnEffect(0)
Bang = 0
T = 0
}

timer("spawn",300)
if(clk("spawn") & Bang == 0){
if(T <= 4){
T+=1
Prop = propSpawn("models/hunter/blocks/cube025x025x025.mdl",0)  
Prop:setMass(1000)
Props:pushEntity(Prop) 
}else{
Bang = 1
}

}

if(Bang){

for(I=0,Props:count()){
Props[I,entity]:applyForce(((E:pos()-Props[I,entity]:pos() + vec(0,I*30,I*30))*50-Props[I,entity]:vel())*Props[I,entity]:mass())    
Ang = (ang(0,90,0)-Props[I,entity]:angles())*1000
Props[I,entity]:applyAngForce(Ang + $Ang*10)
}
    
}


