@name RPG attempt 2
@inputs Turr:entity Ammo:entity Ammo2:entity
@outputs Pos:vector Fire Active
@persist 
@trigger 
runOnTick(1)
if (first()|dupefinished()){
    holoCreate(1)
    holoPos(1,owner():pos()+vec(0,8,20))
    holoParent(1,owner():weapon())
    holoAlpha(1,0)
    holoCreate(2)
    holoPos(2,owner():weapon():pos()-vec(-20,0,-10))
    holoParent(2,owner():weapon())
}    
    
if (owner():weapon():type()=="weapon_rpg"){
    Hand="anim_attachment_RH"
    Turr:setPos(owner():attachmentPos(Hand))
    Turr:propNotSolid(1)
    Turr:setAng(owner():eyeAngles())
    Ammo:setPos(holoEntity(2):pos()+vec(0,0,35))
    
    Ammo:setAng(owner():weapon():angles()+ang(90,0,0))
    Ammo:propNotSolid(1)
    Ammo2:setAng(owner():weapon():angles()+ang(90,0,0))
    Ammo2:propNotSolid(1)
    owner():weapon():setAlpha(0)
if (owner():keyAttack2()==1){Fire=1}
if (owner():keyAttack2()==0){Fire=0}

Active=1
}

if (owner():weapon():type()!="weapon_physgun"){Turr:propNotSolid(0)
    owner():weapon():setAlpha(255)
    Active=0
    Ammo:propNotSolid(0)}
