@name WaterTestLol
@outputs [X X2 Y Y2]:ranger
@persist MainWater:entity Waters:array
@trigger all

runOnTick(1)
E = entity()

if(first()){
propSpawnEffect(0)
E:setAlpha(100)

MainWater = propSpawn("models/hunter/plates/plate.mdl",E:toWorld(vec(0,0,5)),ang(0,0,0),1)
MainWater:setAlpha(200)
MainWater:setMaterial("models/debug/debugwhite")
MainWater:setColor(0,25,255) 
Waters[1,entity] = MainWater
  
}


for(I=1,Waters:count()){

rangerIgnoreWorld(0)
rangerFilter(E)
rangerFilter(MainWater)

X = rangerOffset(5,Waters[I,entity]:pos(),Waters[I,entity]:right())
X2 = rangerOffset(5,Waters[I,entity]:pos(),-Waters[I,entity]:right()) 

if(X:hit() == 0){
Water = propSpawn("models/hunter/plates/plate.mdl",Waters[I,entity]:toWorld(vec(0,I,0))*3,ang(0,0,0),1)
Water:setAlpha(200)
Water:setMaterial("models/debug/debugwhite")
Water:setColor(0,25,255) 
Waters:pushEntity(Water)
}

}    

