@name Heli Holos
@inputs Pod:wirelink [RLG LLG Rotor]:entity 
@outputs 
@persist Spin Rotation 
@trigger 
interval(15)

if (first() | dupefinished()) {
    RLG:setAlpha(0)
    LLG:setAlpha(0)
    
    holoCreate(0)
    holoModel(0,"models/sprops/rectangles/size_1_5/rect_6x192x3.mdl")
    holoPos(0,Rotor:toWorld(vec(0,0,5)))
    holoAng(0,Rotor:toWorld(ang(0,0,0)))
    holoParent(0,Rotor)
    
    holoCreate(1)
    holoModel(1,"models/sprops/cylinders/size_3/cylinder_6x108.mdl")
    holoPos(1,RLG:toWorld(vec(0,0,0)))
    holoAng(1,RLG:toWorld(ang(90,90,90)))
    holoParent(1,RLG)
    
    holoCreate(2)
    holoModel(2,"models/sprops/cylinders/size_3/cylinder_6x108.mdl")
    holoPos(2,LLG:toWorld(vec(0,0,0)))
    holoAng(2,LLG:toWorld(ang(90,90,90)))
    holoParent(2,LLG)
    
    holoCreate(3)
    holoModel(3,"models/sprops/misc/fittings/bend_long_45_6.mdl")
    holoPos(3,RLG:toWorld(vec(-63.8,0,3.9)))
    holoAng(3,RLG:toWorld(ang(35,0,180)))
    holoParent(3,RLG)
    
    holoCreate(4)
    holoModel(4,"models/sprops/misc/fittings/bend_long_45_6.mdl")
    holoPos(4,LLG:toWorld(vec(-63.8,0,3.9)))
    holoAng(4,LLG:toWorld(ang(35,0,180)))
    holoParent(4,LLG)
    
    holoCreate(5)
    holoModel(5,"models/sprops/cylinders/size_2/cylinder_3x48.mdl")
    holoPos(5,RLG:toWorld(vec(44.99999975,-12,24)))
    holoAng(5,RLG:toWorld(ang(0,0,28)))
    holoParent(5,RLG)
    
    holoCreate(6)
    holoModel(6,"models/sprops/cylinders/size_2/cylinder_3x48.mdl")
    holoPos(6,LLG:toWorld(vec(44.99999975,12,24)))
    holoAng(6,LLG:toWorld(ang(0,0,-28)))
    holoParent(6,LLG)
    
    holoCreate(7)
    holoModel(7,"models/sprops/triangles_thin/regular/t_etri_12x12.mdl")
    holoPos(7,RLG:toWorld(vec(44.99999975,-1.4,6)))
    holoAng(7,RLG:toWorld(ang(0,0,28)))
    holoParent(7,RLG)
    
    holoCreate(8)
    holoModel(8,"models/sprops/triangles_thin/regular/t_etri_12x12.mdl")
    holoPos(8,LLG:toWorld(vec(44.99999975,1.4,6)))
    holoAng(8,LLG:toWorld(ang(0,0,-28)))
    holoParent(8,LLG)
}

local Seat = Pod["Entity",entity]
local Driver = Seat:driver()
local Active = Driver:isPlayer()
local R = Driver:keyReload()

if (R) {Spin += 0.1} else {Spin -= 0.1}

Spin = clamp(Spin,20,115)
Rotation += Spin-20

holoAng(0,Rotor:toWorld(ang(0,Rotation/3,0)))

if (changed(R)) {
    if (R) {
        Rotor:soundPlay(0,0,"NPC_AttackHelicopter.Rotors")
    }
}

soundPitch(0,Spin)
soundVolume(0,Spin-20)

if (Spin <= 10) {soundStop(0)}
