@name Targeting system
@inputs [Prop Ammo]:entity 
@outputs 
@persist Props:array Prop:entity Target:entity Seat:entity 
@trigger 
runOnTick(1)

findByClass("prop_vehicle_prisoner_pod")
findSortByDistance(entity():pos())
Seat = findResult(1)

if (owner():aimEntity():model() != "" & owner():aimEntity():isPlayer() | owner():aimEntity():isNPC() | owner():aimEntity() == Seat) {
    for (I = 1,Props:count()) {
        if (Props[I,entity] == owner():aimEntity()) {
        True = 1
        }
    }
    if (changed(owner():keyWalk())& owner():keyWalk()) {
        find():model() == "models/nova/airboat_seat.mdl" | "models/nova/jeep_seat.mdl" | "models/nova/chair_plastic01.mdl"
        holoCreate(1)
        holoMaterial(1,"models/wireframe")
        holoPos(1,owner():aimEntity():pos()+vec(0,0,0))
        holoAng(1,owner():aimEntity():angles())
        holoScale(1,vec(2,2,4))
        holoParent(1,owner():aimEntity())
        holoVisible(1,players(),0)
        holoVisible(1,owner(),1)
        Target = owner():aimEntity()
    }
}

Prop:setAng((Target:pos()+vec(0,0,35) - Prop:pos()):toAngle())
Prop:setPos(entity():pos()+vec(0,0,20))
Ammo:parentTo(entity():isWeldedTo())
