@name Barrel Popper
@inputs 
@outputs 
@persist Swarm:table Com Break Dog:entity SpawnCount
runOnTick(1)
runOnChat(1)
if(first()) 
{
    timer("Start", 10)
    SpawnCount = 0
}

if(clk("Start"))
{
    if(SpawnCount < 1)
    {
        Swarm[SpawnCount:toString(),entity] = propSpawn("models/props_c17/oildrum001_explosive.mdl", Dog:pos(), 0)
        Swarm[SpawnCount:toString(),entity]:propGravity(0)
        Swarm[SpawnCount:toString(),entity]:setMass(50)
        Swarm[SpawnCount:toString(),entity]:setMaterial("phoenix_storms/stripes")
        #Swarm[SpawnCount:toString(),entity]:setTrails(200,100,200,"phoenix_storms/stripes",vec(255,255,255),255)
        Swarm[SpawnCount:toString(),entity]:ignite()
        #Swarm[SpawnCount:toString(),entity]:setNoCollideAll()
    }
}

Chat = owner():lastSaid()
Com = Chat:find("Explode")
Break = Chat:find("|")
if(Com & chatClk(owner()))
{
    ChatArr = Chat:explode("|")
    Dog = findPlayerByName(ChatArr[2,string])
    
    Swarm[SpawnCount:toString(),entity] = propSpawn("models/props_c17/oildrum001_explosive.mdl", Dog:pos(), 0)
    Swarm[SpawnCount:toString(),entity]:propGravity(0)
    Swarm[SpawnCount:toString(),entity]:setMass(50)
    Swarm[SpawnCount:toString(),entity]:setMaterial("phoenix_storms/stripes")
    #Swarm[SpawnCount:toString(),entity]:setTrails(200,100,200,"phoenix_storms/stripes",vec(255,255,255),255)
    Swarm[SpawnCount:toString(),entity]:ignite()
    #Swarm[SpawnCount:toString(),entity]:setNoCollideAll()
}
