@name MoneyFinder Failcake  V1
@inputs 
@outputs Xx Yy Zz Active
@persist Lol
@trigger all

Light = entity():isWeldedTo()
Model = "models/props_c17/consolebox01a.mdl"
######
O = owner()
LS = O:lastSaid()
runOnChat(1) 
if(chatClk(O) & LS == "find") {
    Active = 1
} elseif(chatClk(O) & LS == "stop") {
    Active = 0
}
######
interval(10)

findByModel(Model)    
findSortByDistance( entity():pos() )     
Prop = findResult(1)  

Xx=Prop:pos():x()
Yy=Prop:pos():y()
Zz=Prop:pos():z()
if (Prop:pos():distance(Light:pos()) < 50) {
    Detected = 1
Light:setColor(255, 255, 255)}else{Light:setColor(999999, 9999999, 999999)}

if (Prop:pos():distance(Light:pos()) < 50 ){Lol=1}


if (Prop:pos():distance(Light:pos()) > 50 ) {Lol=0}

