@name House Money Printer Test

@inputs 
@outputs Money
@persist Ang:angle Couchbuy E:entity  Max G:entity
@persist Chat:array  Y  Ents:array Ent:entity
@trigger 
interval(150)
Me = owner()
if(first()){
    Y = 0
    Money = 0
    Print = 1
    Max = 0
    holoCreate(6)
    holoModel(6,"models/props_c17/consolebox05a.mdl")
Couchbuy = 1}
if(Couchbuy == 1){
    Ang = (Me:eyeTrace():hitNormal():toAngle() + ang(-90,0,180)):setYaw((Me:aimPos() - Me:pos() ):toAngle():yaw())
    holoPos(6, Me:aimPos()+vec(0,0,25))
holoAng(6, Ang)}
    if(Me:aimPos():distance(Me:pos()) >= 150){ 
        holoAlpha(6,0)}else{
        holoAlpha(6, 100)
        if(Me:keyAttack1()){
          if(Couchbuy == 1){
            Pos = Me:aimPos()
           E = propSpawn("models/props_c17/consolebox05a.mdl",owner():aimPos()+vec(0,0,25),0)
        E:setAng(Ang)
            Couchbuy = 0
            Print = 0
            holoPos(6,vec(9999,9999,9999))
}}}

if(Print == 0){
    timer("print",10000)}

if(clk("print")){
    if(Max < 1){
    G = propSpawn("models/props/cs_assault/Money.mdl",E:toWorld(vec(20,0,5)),Ang,0)
Y++
Max++
}}
timer("check",300)
Distance = 150
Result = ""
Times = 100
Damage = 20
if (clk("check")) {
    findInSphere(G:pos(), Distance)
    Array = findToArray()
    for(I=1,Array:count()) {
        if(Array[I,entity]:isPlayer()) {
            if(Array[I,entity]:isAlive()) {
                if (Result != "whip") {                  
  
 P = findClosest(entity():pos())
    Use = P:keyUse()
    Hp = " 10"
    Name=P:name()
    if(Use==1){
Ents[Y,entity] = G
Y = 0
Max = 0
Ents:propDelete()

}}}}}}
