@name Croco's Rocket Launcher e2
@outputs T
@persist Y Ent:entity Ents:array Limit Boom:entity Head:string Ent4:entity
@trigger 
@model models/weapons/w_models/w_rocket.mdl
    runOnTick(200)
    holoCreate(2)
    holoModel(2,"models/weapons/w_models/w_rocket.mdl")
    holoAng(2,Ent4:angles())
        holoPos(2,Ent4:pos())
        if (first()) {Y = 1 Limit = 2}
        if (owner():keyReload()) {
        if (Y <= Limit) {Ent = propSpawn("models/props_phx/misc/egg.mdl",owner():shootPos()  + vec(0,0,100),1)
            Ent4 = propSpawn("models/sprops/rectangles/size_1/rect_3x3x3.mdl",Ent:pos() + vec(0,0,3), 0) Y++}
        holoCreate(2)
        holoModel(2,"models/weapons/w_models/w_rocket.mdl")
        holoPos(2,Ent4:pos() + vec(0,0,10))
        holoParent(2,Ent)
        holoAlpha(2,255)
        Ent4:weld(Ent)
        Ent4:setMass(0.000001)
        Ent:setMass(50)
        Ent:setPos(owner():shootPos() + vec(0,-5,0) + entity():forward()*24)
        Ent:setAng(ang(0,0,80) + owner():eyeAngles())
        Ent:propFreeze(0)
        Ent:applyForce(owner():eyeAngles():forward()*10000000*Ent:mass())
        Ent:applyAngForce(-Ent:angles() + ang(0,curtime()*10000000,900)*Ent:mass())
        Ents[Y,entity] = Ent4
        T = 1

}

if(!Ent){
    if(T == 1){
        Ent4:propFreeze(1)
     Ent3 = propSpawn("models/props_phx/ball.mdl",Ent4:pos(),1)
    Ent3:propBreak()   
    T = 0
    Ents:propDelete() Y = 1
    Ent4:propDelete()
}}


        if (owner():keyAttack2()){Ents:propDelete() Y = 1}
        if (owner():weapon():type()=="weapon_pistol"){
        Head="anim_attachment_RH"
        for(I=1,1){
        setName("Croco's Rocket Launcher E2")
        holoCreate(I)
        holoPos(I,owner():attachmentPos(Head))
        holoAng(I,owner():attachmentAng(Head))
        holoPos(I,holoEntity(I):toWorld(vec(-10,-3,-2+(-I*0))))
        holoAng(I,holoEntity(I):toWorld(ang(0,10,(-I*10)-0)))
        holoParentAttachment(I,owner(),Head)
        holoModel(I,"models/weapons/w_models/w_rocketlauncher.mdl")
        holoScale(I,vec(1,1,1))
        holoAlpha(I,255)
        owner():weapon():setColor(0,0,0,0)}
        }else{holoAlpha(1,0) owner():weapon():setColor(255,255,255,255)}

    
