@name RangerTripField
@inputs Button
@outputs D
@persist E:array EN:string EC DO EO:array On
interval(10)
if(holoEntity(0)){
    if(findCanQuery()){
        E=array()
        findByClass("player")
        findClipToSphere(entity():pos(),DO*0.6)
        E=findToArray()
    }

    if(!Button&abs($Button)){
        holoDelete(0)
        holoDelete(2)
    }
    for(I=1,E:count()){
        if (E[I,entity]!=EO[I,entity]&E[I,entity]:isPlayer()) {
            EN=E[I,entity]:name()
            hint(EN + "Is In Area", 5)
            holoColor(0, vec(20,20,255), 255)
            holoColor(2, vec(20,20,255), 255)
            EO[I,entity] = E[I,entity]
            timer("AO", 2000)
        }
    }
    if (clk("AO")) {
        EO=array()
        holoColor(0, vec(255,20,20),255)
        holoColor(2, vec(255,20,20),255)
    }
}else{
    if((Button&~Button)|first()){
        DO=300
        holoCreate(0, entity():pos(),vec(0,0,0),ang(0,0,0),vec(255,20,20),"icosphere3")
        holoParent(0, entity())
        holoMaterial(0, "Models/effects/vol_light001")
        holoScaleUnits(0,vec(DO,DO,DO))
        
        holoCreate(1, entity():pos()+entity():up(),vec(1.1,1.1,0.4),ang(0,0,0),vec(0,0,0),"icosphere")
        holoParent(1, entity())
        holoMaterial(1, "phoenix_storms/black_chrome")
        
        holoCreate(2, entity():pos(),vec(0,0,0),ang(0,0,0),vec(255,20,20),"icosphere3")
        holoParent(2, entity())
        holoMaterial(2, "Models/effects/vol_light001")
        holoScaleUnits(2,-vec(DO,DO,DO))
    }
}
