@name Money grabber
@inputs Colorer:entity
@outputs R G B Fire
@persist Money:entity Cash:array Ang
@model models/props_phx/gears/bevel12.mdl

if(first()){
 runOnTick(1)   
 R = 255
 G = 255
 B = 255
 #Fire = 1
}

Ang = Ang+2.5
entity():setAng(ang(0,Ang,0))

if(findCanQuery()){
 findByClass("sent_egi_money")   
 Cash = findToArray()
}

if(Cash:count()>0){
 for(I=1,Cash:count()){
 M = Cash[I,entity]
 M:setPos(entity():pos()+vec(0,0,I*15))   
 M:setAng(ang())
 #M:propDelete()
 if(I==Cash:count()){
 Colorer:setPos(M:pos()+vec(0,0,15))   
 Colorer:setAng(ang(180,0,0))
if(Colorer:pos():x()==M:pos():x()&Colorer:pos():y()==M:pos():y()){
    Fire = 1
} else { Fire = 0 }
}
}   
}
