@name Vis so storony zhopy
@inputs Cam:wirelink
@outputs 
@persist O:entity Health A:vector I J PosC:vector
@trigger 

runOnTick(1)

Cam["Direction",vector]=O:eye()
if(O:shootPos():isInWorld()){
    Cam["Activated",number]=1
}
else{
    Cam["Activated",number]=0
}
if(O:keyUse()){
    PosC=O:eye()*(-100+I)+O:shootPos()
    Cam["Position",vector]=PosC
    if(!O:isCrouch()){
        I+=7
    }  
}
else{
    I=0
    PosC=O:eye()*(-100+J)+O:shootPos()
    if(!PosC:isInWorld()){
        J+=20
    }
    else{
        J=0
    }
    Cam["Position",vector]=PosC
}
holoPos(1,O:eye()*-80+O:shootPos())
if(O:aimEntity():isPlayer()|O:aimEntity():isNPC()){
    if(O:aimEntity():health()>100){
        Health=255
    }
    else{
        Health=255/100*O:aimEntity():health()
    }
    A=hsv2rgb(rgb2hsv(vec(255,0,0)):setX(Health))
    holoColor(1,A)#vec(Health,255-Health,255-Health))
}
elseif(O:aimEntity()!=noentity()){
    holoColor(1,vec(0,255,0))
}
else{
    holoColor(1,vec(255,255,255))
}
if(first()|duped()){
    O=owner()
    holoCreate(1,O:pos())
    holoModel(1,"cone")
    holoShadow(1,0)
    #holoMaterial(1,"models/shiny")
    holoMaterial(1,"models/debug/debugwhite")
    holoScaleUnits(1,vec(0.5,0.5,0.5))
    holoColor(1,vec(255,255,255))
    #holoRenderFX(1,0)
}
