@name 3d holo finding device
@inputs 
@outputs R:array Inc [P F]:entity 
@persist Player Clk Next Prev
interval(10)
E = entity():isWeldedTo()
if(first()){
    hint("Use your USE key to select a person's objects",5)
    holoCreate(1)
    holoModel(1,"pyramid")
    holoScaleUnits(1,vec(3,3,20))
    holoCreate(2)
    holoAlpha(2,200)
    holoScale(2,vec(1,1,1)/2)
    holoColor(1,vec(100,255,0))
    holoColor(2,vec(100,255,0))
    for(I=3,20){
        holoCreate(I)
        holoScaleUnits(I,vec(2,2,20))
        holoModel(I,"hqcylinder2")
        holoColor(I,vec(100,255,0))
    }
}
Clk = owner():keyUse()
if(Clk & $Clk){
    R = array()
    P = noentity()
    Inc = 0
    if(owner():aimEntity():type()=="player"){
        P = owner():aimEntity()
    }else{
        P = owner():aimEntity():owner()
    }
    printColor(vec(255,0,0),"Found the user "+P:name())
}
Player = P:id()
if(findCanQuery() & P & (Player & $Player)){
    R = array()
    findIncludePlayerProps(P)
    findByClass("*")
    findExcludeClass("weapon_*")
    findExcludeClass("tool*")
    R = findToArray()
    printColor(vec(255,150,90),"Found all entities, right/left click to search")
}
Next = owner():keyAttack2() & owner():isCrouch() & owner():inNoclip()
Prev = owner():keyAttack1() & owner():isCrouch() & owner():inNoclip()
F = R:entity(Inc)
if(Next & $Next & Inc<R:count()){
    Inc++
}elseif(Prev & $Prev & Inc>0){
    Inc--
}
holoPos(1,owner():shootPos()+owner():eye()*40)
holoAng(1,(holoEntity(1):pos()-F:pos()):toAngle())
holoAng(1,holoEntity(1):toWorld(ang(90,180,0)))
holoPos(2,F:pos())
for(I=3,20){
    holoPos(I,F:pos()+(holoEntity(1):pos()-F:pos())*(I/21))
    holoAng(I,holoEntity(1):angles())
}
