@name FireTest Gasoline
@outputs Timeout Holos Prop:array
@persist I 
@trigger all
@model models/props_junk/gascan001a.mdl
runOnTick(1)

O = owner()

if(first()){
print(holoRemainingSpawns())  
I = 0
Holos = holoRemainingSpawns()
}

if(O:keyUse()& Timeout == 0){
    
if(I <= Holos){
I++
holoCreate(I)
holoModel(I,"hqcylinder")
holoPos(I,O:aimPos())
holoScale(I,vec(1,1,0.1))  
holoColor(I,vec(96,54,7))
holoMaterial(I,"models/shadertest/predator")
Timeout = 1
}else{
I = 0
} 
}

## Find And Burn
findByModel("models/Gibs/wood_gib01e.mdl")
Prop = findToArray()

if(I >= 0 ){
    
for(P2=1,I){
    
if(Prop[1,entity]:pos():distance(holoEntity(P2):pos()) <= 30 & Prop[1,entity]:isOnFire() | holoEntity(P2):isOnFire() ){
holoEntity(P2):ignite(100)    
}
    
}   
 
}

if(Timeout){
timer("wait",100)    
if(clk("wait")){
Timeout = 0    
}    
}
