@name Nano-swarm Server
@inputs 
@outputs 
@persist Swarm:table Com Break Dog:entity
runOnTick(1)
runOnChat(1)
if(first()) 
{
    
    for(I = 0, 5, 1)
    {
        Swarm[I:toString(),entity] = propSpawn("models/hunter/plates/plate.mdl", 0)
        Swarm[I:toString(),entity]:propGravity(0)
        Swarm[I:toString(),entity]:setMass(50)
        Swarm[I:toString(),entity]:setMaterial("phoenix_storms/stripes")
        #Swarm[I:toString(),entity]:ignite()
        #Swarm[I:toString(),entity]:setNoCollideAll()
    }
}

Chat = owner():lastSaid()
Com = Chat:find("Swarm")
Break = Chat:find("|")
if(Com & chatClk(owner()))
{
    ChatArr = Chat:explode("|")
    Dog = entity(findByName(ChatArr[2,string]))
}




if(Dog:isValid())
{
    print("Hello")
    foreach(K, V:entity=Swarm)
    {
        RelativeXYZ= Dog:shootPos() - V:pos()
    
    
        Var1 = 100*RelativeXYZ
    
        V:applyForce(Var1)
    }
}
