@name HoloErza landspeeder
@inputs Pod:wirelink
@outputs 
@persist E:entity Height Width Length Roll R Pitch Middle Thrust Yaw T Active Flash
@persist Spawn Display Up Material:string DirTable:table Fire Mul Prop:entity Props:array Color2:vector TT Retract TT2 Amode:string Scroll Size AnPlus Bar:table Anim Mode List:table Off:table Modes:table Sound:table Settings:table Info:table
@model models/hunter/plates/plate1x2.mdl
@trigger 

if(first()) {
Width=45
Length=25    
E=entity() E:setMass(500)
Height=43

Color1=vec(255,211,177) Color2=vec(255,100,100)
Material="models/props_canal/canal_bridge_railing_01c"
rangerHitWater(1)
rangerFilter(players())
rangerFilter(E)
rangerFilter(E:getConstraints())
rangerPersist(1)
runOnTick(1)
#model
print("LR LandSpeeder: Spawning..")
holoCreate(1)
holoPos(1,E:toWorld(vec(0,80,7)))
holoAng(1,E:toWorld(ang(0,0,0)))
holoScale(1,vec(5,5,1.5))
holoModel(1,"hq_rcylinder_thick")
holoParent(1,E) holoColor(1,Color1)
holoMaterial(1,Material) 

holoCreate(2)
holoPos(2,E:toWorld(vec(0,55,7)))
holoAng(2,E:toWorld(ang(0,0,0)))
holoScale(2,vec(5,8,1.5))
holoModel(2,"hq_rcube_thick")
holoParent(2,E) holoColor(2,Color1)
holoMaterial(2,Material)

holoCreate(3)
holoPos(3,E:toWorld(vec(24,0,7)))
holoAng(3,E:toWorld(ang(0,0,0)))
holoScale(3,vec(1,12,1.5))
holoModel(3,"hq_rcube_thick")
holoParent(3,E) holoColor(3,Color2)
holoMaterial(3,Material)

holoCreate(4)
holoPos(4,E:toWorld(vec(-24,0,7)))
holoAng(4,E:toWorld(ang(0,0,0)))
holoScale(4,vec(1,12,1.5))
holoModel(4,"hq_rcube_thick")
holoParent(4,E) holoColor(4,Color2)
holoMaterial(4,Material)

holoCreate(5)
holoPos(5,E:toWorld(vec(0,-60,7)))
holoAng(5,E:toWorld(ang(0,0,0)))
holoScale(5,vec(5,3,1.5))
holoModel(5,"hq_rcube_thick")
holoParent(5,E) holoColor(5,Color1)
holoMaterial(5,Material)

holoCreate(6)
holoPos(6,E:toWorld(vec(0,10,-1)))
holoAng(6,E:toWorld(ang(0,0,0)))
holoScale(6,vec(4,12,0.2))
holoModel(6,"hq_rcube_thin")
holoParent(6,E) holoMaterial(6,"phoenix_storms/metal")
holoColor(6,vec(100,100,100))

holoCreate(7)
holoPos(7,E:toWorld(vec(50,-30,7)))
holoAng(7,E:toWorld(ang(0,0,90)))
holoScale(7,vec(1.8,1.6,18))
holoModel(7,"hq_torus_thick")
holoParent(7,E) holoColor(7,Color2)
holoMaterial(7,Material)

holoCreate(8)
holoPos(8,E:toWorld(vec(-50,-30,7)))
holoAng(8,E:toWorld(ang(0,0,90)))
holoScale(8,vec(1.8,1.6,18))
holoModel(8,"hq_torus_thick")
holoParent(8,E) holoColor(8,Color2)
holoMaterial(8,Material)

holoCreate(9)
holoPos(9,E:toWorld(vec(-34,-30,7)))
holoAng(9,E:toWorld(ang(90,0,0)))
holoScale(9,vec(1.3,4,2))
holoModel(9,"hq_rcylinder")
holoParent(9,E) holoColor(9,Color2)
holoMaterial(9,Material)

holoCreate(10)
holoPos(10,E:toWorld(vec(34,-30,7)))
holoAng(10,E:toWorld(ang(90,0,0)))
holoScale(10,vec(1.3,4,2))
holoModel(10,"hq_rcylinder")
holoParent(10,E) holoColor(10,Color2)
holoMaterial(10,Material)
  
holoCreate(11)
holoPos(11,E:toWorld(vec(0,20,20)))
holoAng(11,E:toWorld(ang(0,0,45)))
holoScale(11,vec(4.5,0.3,1.8))
holoModel(11,"hq_rcylinder_thin")
holoParent(11,E) holoColor(11,vec(100,100,100))
holoMaterial(11,"models/props_combine/citadel_cable")

holoCreate(12)
holoPos(12,E:toWorld(vec(26.8,9.6,13.5)))
holoAng(12,E:toWorld(ang(0,1,45)))
holoScale(12,vec(0.1,2,1.32))
holoModel(12,"hq_rcube_thin")
holoParent(12,E) holoColor(12,vec(100,100,100))
holoMaterial(12,"models/props_combine/citadel_cable")

holoCreate(13)
holoPos(13,E:toWorld(vec(-26.8,9.6,13.5)))
holoAng(13,E:toWorld(ang(0,-1,45)))
holoScale(13,vec(0.1,2,1.32))
holoModel(13,"hq_rcube_thin")
holoParent(13,E) holoColor(13,vec(100,100,100))
holoMaterial(13,"models/props_combine/citadel_cable")

#engine details
holoCreate(14)
holoPos(14,E:toWorld(vec(-50,-50,7)))
holoAng(14,E:toWorld(ang(0,0,90)))
holoScale(14,vec(1.7,1.5,4.5))
holoModel(14,"hq_cone")
holoParent(14,E) holoColor(14,Color1)
holoMaterial(14,Material)

holoCreate(15)
holoPos(15,E:toWorld(vec(50,-50,7)))
holoAng(15,E:toWorld(ang(0,0,90)))
holoScale(15,vec(1.7,1.5,4.5))
holoModel(15,"hq_cone")
holoParent(15,E) holoColor(15,Color1)
holoMaterial(15,Material)

holoCreate(16)
holoPos(16,E:toWorld(vec(-50,0,7)))
holoAng(16,E:toWorld(ang(45,0,-90)))
holoScale(16,vec(1.5,0.4,2))
holoModel(16,"hq_cone")
holoParent(16,E) holoColor(16,Color1)
holoMaterial(16,Material)

holoCreate(17)
holoPos(17,E:toWorld(vec(-50,0,7)))
holoAng(17,E:toWorld(ang(-45,0,-90)))
holoScale(17,vec(1.5,0.4,2))
holoModel(17,"hq_cone")
holoParent(17,E) holoColor(17,Color1)
holoMaterial(17,Material)

holoCreate(18)
holoPos(18,E:toWorld(vec(50,0,7)))
holoAng(18,E:toWorld(ang(45,0,-90)))
holoScale(18,vec(1.5,0.4,2))
holoModel(18,"hq_cone")
holoParent(18,E) holoColor(18,Color1)
holoMaterial(18,Material)

holoCreate(19)
holoPos(19,E:toWorld(vec(50,0,7)))
holoAng(19,E:toWorld(ang(-45,0,-90)))
holoScale(19,vec(1.5,0.4,2))
holoModel(19,"hq_cone")
holoParent(19,E) holoColor(19,Color1)
holoMaterial(19,Material)

holoCreate(20)
holoPos(20,E:toWorld(vec(0,-75,30)))
holoAng(20,E:toWorld(ang(0,0,90)))
holoScale(20,vec(1.8,1.6,16))
holoModel(20,"hq_torus_thick")
holoParent(20,E) holoColor(20,Color2)
holoMaterial(20,Material)

holoCreate(21)
holoPos(21,E:toWorld(vec(0,-48,30)))
holoAng(21,E:toWorld(ang(45,0,-90)))
holoScale(21,vec(1.5,0.4,2))
holoModel(21,"hq_cone")
holoParent(21,E) holoColor(21,Color1)
holoMaterial(21,Material)

holoCreate(22)
holoPos(22,E:toWorld(vec(0,-48,30)))
holoAng(22,E:toWorld(ang(-45,0,-90)))
holoScale(22,vec(1.5,0.4,2))
holoModel(22,"hq_cone")
holoParent(22,E) holoColor(22,Color1)
holoMaterial(22,Material)

holoCreate(23)
holoPos(23,E:toWorld(vec(0,-92,30)))
holoAng(23,E:toWorld(ang(0,0,90)))
holoScale(23,vec(1.7,1.5,4.5))
holoModel(23,"hq_cone")
holoParent(23,E) holoColor(23,Color1)
holoMaterial(23,Material)

holoCreate(24)
holoPos(24,E:toWorld(vec(0,-70,15)))
holoAng(24,E:toWorld(ang(0,0,10)))
holoScale(24,vec(1,1.5,2))
holoModel(24,"hq_rcube_thin")
holoParent(24,E) holoColor(24,Color2)
holoMaterial(24,Material)

#general details
holoCreate(25)
holoPos(25,E:toWorld(vec(12,54,15)))
holoAng(25,E:toWorld(ang(1,2,0)))
holoScale(25,vec(1.5,6,0.2))
holoModel(25,"hq_rcube")
holoParent(25,E)  holoColor(25,Color2)
holoMaterial(25,Material)

holoCreate(26)
holoPos(26,E:toWorld(vec(-12,54,15)))
holoAng(26,E:toWorld(ang(-1,-2,0)))
holoScale(26,vec(1.5,6,0.2))
holoModel(26,"hq_rcube")
holoParent(26,E) holoColor(26,Color2)
holoMaterial(26,Material)
#interior
holoCreate(27)
holoPos(27,E:toWorld(vec(0,14,15)))
holoAng(27,E:toWorld(ang(0,0,0)))
holoScale(27,vec(4.5,1.4,0.2))
holoModel(27,"hq_rcube")
holoParent(27,E) holoColor(27,vec(100,100,100))
holoMaterial(27,Material)

holoCreate(28)
holoPos(28,E:toWorld(vec(0,5,12)))
holoAng(28,E:toWorld(ang(0,0,45)))
holoScale(28,vec(4.5,0.7,0.2))
holoModel(28,"hq_rcube")
holoParent(28,E) holoColor(28,vec(100,100,100))
holoMaterial(28,Material)
List=table("/music/hl1_song25_remix3.mp3","/music/hl2_song23_suitsong3.mp3","/music/hl2_song20_submix0.mp3"
,"/music/portal_still_alive.mp3","/music/hl2_song31.mp3","/music/hl2_song3.mp3","/music/hl2_song19.mp3"
,"/music/hl2_song4.mp3","/music/hl1_song17.mp3","/music/portal_you_cant_escape_you_know.mp3")
Sound=table(vec(255,0,0),List)
List=table("mysounds/1.mp3","mysounds/2.mp3","mysounds/3.mp3","mysounds/4.mp3","mysounds/5.mp3","mysounds/6.mp3","mysounds/7.mp3","mysounds/8.mp3","mysounds/9.mp3","mysounds/10.mp3")
Settings=table(vec(0,255,0),List)
List=table("blank","circle","triangle","weapon")
Info=table(vec(0,0,255),List)
Off=table(vec(0,0,0))

#entertainment system variables
Modes=table(Sound,Settings,Info,Off)
Mode=4
Amode="blank"

Up=10
E:setAlpha(0) Spawn++
  }
if(Spawn>0) {Spawn++}


if(!E:isFrozen() & Spawn==0) {
Dir=-E:up()  
    
    On=Pod["Active",number]
if(On==1) {
    W = Pod["W",number] A = Pod["A",number]  R = Pod["R",number]  Flash = Pod["Light",number]
    S = Pod["S",number] D = Pod["D",number]  Pod["Crosshairs",number]=1
    M1 = Pod["Mouse1",number]  M2 = Pod["Mouse2",number] Driver = Pod["Entity",entity]:driver()
    Space = Pod["Space",number] Alt = Pod["Alt",number] Shift = Pod["Shift",number]    
        WpnUp = Pod["NextWeapon",number] WpnDown = Pod["PrevWeapon",number]
    
    
if(changed(R) & R) {Active = !Active}
if(changed(Flash) & Flash) {Display = !Display E:soundPlay(3,0,"/buttons/button3.wav")}
if(changed(Yaw)) {
    
  holoAng(29,E:toWorld(ang(Yaw*-12,0,0)))  
    }

Yaw+=(A-D)/5
Yaw-=Yaw/20
if(Yaw>15) {Yaw=15} if(Yaw<-15) {Yaw=-15}
Pi=(Shift-Alt)*-10

#entertainment system
if(Mode!=4) {
if(changed(WpnUp) & WpnUp) {Scroll-- E:soundPlay(7,0,"/buttons/button15.wav")}
if(changed(WpnDown) & WpnDown) {Scroll++ E:soundPlay(7,0,"/buttons/button15.wav")}
}
if(changed(M2) & M2) {Mode++}
if(Mode>Modes:count()) {Mode=1}
if(changed(Mode)) { soundStop(4) Scroll=1
for(I=42,45) {
holoColor(I,Modes[Mode,table][1,vector])    
} E:soundPlay(5,0,"/buttons/blip1.wav")
if(Amode=="blank") {holoColor(45,vec())}
Bar=Modes[Mode,table][2,table]   Size=Bar:count()
}
if(Scroll>Size) {Scroll=Size}
if(Scroll<1) {Scroll=1}    
if(changed(Scroll) | changed(Mode)) { AnPlus=8
P=(4.8/Size*Scroll)/2    
if(Mode!=3) {
soundPlay(4,0,Bar[Scroll,string])}
holoScaleUnits(44,vec((4.8/Size*Scroll)*0.9,0.075*12,0.05*12))       
holoPos(44,holoEntity(41):toWorld(vec(4.6-P,-2.7,-1.8)))    
}
if(Mode==3) {
Amode=Bar[Scroll,string]
if(changed(Amode)) {}    
if(Amode=="circle") {
holoModel(45,"hq_tube")}
if(Amode=="triangle") {
holoModel(45,"hexagon")
holoColor(45,vec(0,0,255))
}    
if(Amode=="blank") {
holoColor(45,vec(0,0,0))
}

if(Amode=="weapon") {
holoModel(45,"torus")
holoScaleUnits(45,vec(3,3,3)) holoAng(45,holoEntity(41):toWorld(ang(0,0,90)))
}    
    }
if(Amode=="weapon" & Retract<20) {Retract+=0.5 holoPos(46,E:toWorld(vec(-8-Retract,50,7))) }
 if(Amode!="weapon" & Retract>0) {Retract-=0.5 holoPos(46,E:toWorld(vec(-8-Retract,50,7))) }
    
    
#animations for entertainment system
if(Mode!=4) {
if(AnPlus>1) {AnPlus-=0.2}
    
Anim+=AnPlus   
holoAng(42,holoEntity(41):toWorld(ang(Anim*1.5,0,90)))   
if(Amode=="circle") {
TT+=0.02 TT2+=0.02
if(TT>=3) {TT=0}   if(TT2>=3.1) {TT2=TT}   
holoScaleUnits(45,vec(TT,TT,0.05*12))    
holoColor(45,Modes[Mode,table][1,vector]*(1-(TT2/3.1)))    
 }
if(Amode=="triangle") {
TT+=3

holoScaleUnits(45,vec(1.8+1*cos(TT),1.8+1*cos(TT),0.05*12))    
holoAng(45,holoEntity(41):toWorld(ang(TT,0,90)))   
 }

    }


}else{Thrust=0 Yaw=0}    

if(changed(Active) & !Active) {
 soundStop(1)   soundStop(2)
    Thrust=0 Yaw=0 T=110
    }     


if(Active) { 
if(Display& Up<22) {Up+=0.1 holoPos(33,E:toWorld(vec(-10,10,Up)))}
if(!Display & Up>10) {Up-=0.1 holoPos(33,E:toWorld(vec(-10,10,Up)))}
if(Display) {
holoPos(37,holoEntity(33):toWorld(vec(0,-0.12,E:right():z()*-5)))
holoAng(37,holoEntity(33):toWorld(ang(180-E:forward():z()*50,0,0)))
holoPos(39,holoEntity(33):toWorld(vec(5,-0.12,-5.5+Thrust/18)))    
    
    }

#weapons system
#ifdef propSpawn(string,vector,angle,number) 
if(Retract>19) {
if(M1 & Fire==0) {
Fire+=1    
 E:soundPlay(6,0,"supermario64.mp3")   soundPitch(6,240+T/80)

 Prop=propSpawn("models/props_phx/mk-82.mdl",holoEntity(47):toWorld(vec(0,0,0)),-holoEntity(47):angles(),0)  
  Props:pushEntity(Prop)
  Prop:setMass(2000)  Prop:setAlpha(0)
  Prop:setTrails(40,40,0.1,"trails/laser",vec(100,255,100),255)
  DirTable:pushVector(-holoEntity(47):up())

  }
if(Fire>0) {Fire+=1
Mul=5*cos(Fire)    
    
holoPos(47,E:toWorld(vec(-35,60-Mul,7)))   
}
if(Fire>100) {Fire=0 }

for(N=1,Props:count()) {
Props[N,entity]:applyForce(DirTable[N,vector]*1000000)       
Props[N,entity]:setPos(Props[N,entity]:pos()+DirTable[N,vector]*100)      
rangerFilter(Props[N,entity])
Ranger=rangerOffset(1000,Props[N,entity]:pos(),Props[N,entity]:vel():normalized())
if(Ranger:distance()<210 | !Props[N,entity]:pos():isInWorld()) {Props[N,entity]:propBreak()}    
 if(Props[N,entity]==noentity()) {Props:remove(N) DirTable:remove(N) }   
     
    
    }


}    
  #endif  
    
    
    


Thrust+=(W-S)
if(Thrust>200) {Thrust=200}
if(Thrust<0) {Thrust=0}
    
 T++
if(T>120) {T=0 E:soundPlay(2,0,"/ambient/atmosphere/city_rumble_loop1.wav") soundVolume(2,0.4) E:soundPlay(1,0,"/npc/combine_gunship/engine_whine_loop1.wav") soundVolume(1,0.7) }
soundPitch(1,20+Thrust+T/80) soundPitch(2,20+Thrust+T/80)     
       
#Rear Right
RangerRR=rangerOffset(200,E:toWorld(vec(Length,0,0)),Dir)
PosRR=RangerRR:position()
DistRR=RangerRR:distance()
#Rear Left
RangerRL=rangerOffset(200,E:toWorld(vec(-Length,0,0)),Dir)
PosRL=RangerRL:position()
DistRL=RangerRL:distance()
#Front Right
RangerFR=rangerOffset(200,E:toWorld(vec(0,Width,0)),Dir)
PosFR=RangerFR:position()
DistFR=RangerFR:distance()
#Front Left
RangerFL=rangerOffset(200,E:toWorld(vec(0,-Width,0)),Dir)
PosFL=RangerFL:position()
DistFL=RangerFL:distance()

Middle=(DistFL+DistFR+DistRR+DistRL)/4

if(Middle<=Height+30) {
    
Z=(PosFL:z()+PosFR:z()+PosRR:z()+PosRL:z())/4    
    
Pos=vec(E:pos():x(),E:pos():y(),Z+Height)+E:right()*-Thrust*1.4    
applyForce(((Pos-entity():pos())*5-entity():vel())*entity():mass())   

Roll=(PosFR:z()-PosFL:z())/1.5
Pitch=(PosRR:z()-PosRL:z())


Torque = E:toLocal(rotationVector(quat(ang(-Pitch+Yaw*-5,E:angles():yaw()+Yaw*1.5,Roll+Pi)) / quat(E)) + E:pos())
E:applyTorque((Torque*200-E:angVelVector()*20)*E:inertia())
    
    
    
    
    
    
    }

}
}    
    
 if(Spawn==100) {
#cockpit etc    
holoCreate(29)
holoPos(29,E:toWorld(vec(-10,5,12)))
holoAng(29,E:toWorld(ang(0,0,0)))
holoScale(29,vec(0.2,1,0.2))
holoModel(29,"hq_rcube")
holoMaterial(29,Material)
holoParent(29,E) holoColor(29,vec(100,100,100))
 

holoCreate(30)
holoPos(30,E:toWorld(vec(-10,0,12)))
holoAng(30,E:toWorld(ang(0,90,0)))
holoScale(30,vec(0.2,1,0.2))
holoModel(30,"hq_rcube")
holoParent(30,29) holoColor(30,vec(100,100,100))
holoMaterial(30,Material)

holoCreate(31)
holoPos(31,E:toWorld(vec(-4.6,0,10.5)))
holoAng(31,E:toWorld(ang(0,0,90)))
holoScale(31,vec(0.2,0.6,0.2))
holoModel(31,"hq_rcube")
holoMaterial(31,Material)
holoParent(31,29) holoColor(31,vec(100,100,100))    

holoCreate(32)
holoPos(32,E:toWorld(vec(-15.4,0,10.5)))
holoAng(32,E:toWorld(ang(0,0,90)))
holoScale(32,vec(0.2,0.6,0.2))
holoModel(32,"hq_rcube")
holoMaterial(32,Material)
holoParent(32,29) holoColor(32,vec(100,100,100))       

#pop up display
holoCreate(33)
holoPos(33,E:toWorld(vec(-10,10,10)))
holoAng(33,E:toWorld(ang(0,0,0)))
holoScale(33,vec(1.5,0.1,1))
holoAlpha(33,200) holoMaterial(33,"lights/white001")
holoModel(33,"cube")
holoParent(33,E) holoColor(33,vec(0,0,0))

holoCreate(34)
holoPos(34,E:toWorld(vec(-16,9.6,10)))
holoAng(34,E:toWorld(ang(0,0,0)))
holoScale(34,vec(0.07,0.03,1))
holoMaterial(34,"lights/white001")
holoModel(34,"cube")
holoParent(34,33) holoColor(34,vec(255,0,0))

holoCreate(35)
holoPos(35,E:toWorld(vec(-4,9.6,10)))
holoAng(35,E:toWorld(ang(0,0,0)))
holoScale(35,vec(0.07,0.03,1))
holoMaterial(35,"lights/white001")
holoModel(35,"cube")
holoParent(35,33) holoColor(35,vec(255,0,0))  

holoCreate(36)
holoPos(36,E:toWorld(vec(-10,9.6,10)))
holoAng(36,E:toWorld(ang(0,0,0)))
holoScale(36,vec(1.5,0.03,0.07))
holoMaterial(36,"lights/white001")
holoModel(36,"cube")
holoParent(36,33) holoColor(36,vec(255,0,0))    

holoCreate(37)
holoPos(37,holoEntity(33):toWorld(vec(0,-0.1,0)))
holoAng(37,holoEntity(33):toWorld(ang(0,0,0)))
holoScale(37,vec(0.6,0.05,0.2))
holoMaterial(37,"lights/white001")
holoModel(37,"prism")
holoParent(37,33) holoColor(37,vec(255,0,0))  

holoCreate(38)
holoPos(38,E:toWorld(vec(-10,10,10)))
holoAng(38,E:toWorld(ang(0,0,90)))
holoScale(38,vec(1.55,1.1,0.11))
holoMaterial(38,Material)
holoModel(38,"hq_stube_thin")
holoParent(38,33) holoColor(38,vec(100,100,100))
}
if(Spawn==200) {
holoCreate(39)
holoPos(39,holoEntity(33):toWorld(vec(5,-0.1,0)))
holoAng(39,holoEntity(33):toWorld(ang(0,0,0)))
holoScale(39,vec(0.2,0.05,0.07))
holoMaterial(39,"lights/white001")
holoModel(39,"cube")
holoParent(39,33) holoColor(39,vec(255,0,0))   
  
##radio satnavblablabla
holoCreate(40)
holoPos(40,E:toWorld(vec(0,6.1,11.2)))
holoAng(40,E:toWorld(ang(180,0,35)))
holoScale(40,vec(1.5,0.495,0.6))
holoModel(40,"prism")
holoMaterial(40,Material)
holoParent(40,E) holoColor(40,vec(100,100,100))

holoCreate(41)
holoPos(41,E:toWorld(vec(0,6,11.2)))
holoAng(41,E:toWorld(ang(180,0,34)))
holoScale(41,vec(1.3,0.49,0.5))
holoModel(41,"prism")
holoMaterial(41,"lights/white001")
holoParent(41,E) holoColor(41,vec(0,0,0))

holoCreate(42)
holoPos(42,holoEntity(41):toWorld(vec(-3.5,-2.7,-1.8)))
holoAng(42,holoEntity(41):toWorld(ang(0,0,90)))
holoScale(42,vec(0.15,0.15,0.05))
holoModel(42,"hexagon")
holoMaterial(42,"lights/white001")
holoParent(42,41) holoColor(42,vec(0,0,0))

holoCreate(43)
holoPos(43,holoEntity(41):toWorld(vec(2.2,-2.7,-1.8)))
holoAng(43,holoEntity(41):toWorld(ang(0,0,90)))
holoScaleUnits(43,vec(0.4*12,0.08*12,0.05*12))
holoModel(43,"hq_stube_thin")
holoMaterial(43,"lights/white001")
holoParent(43,41) holoColor(43,vec(0,0,0))

holoCreate(44)
holoPos(44,holoEntity(41):toWorld(vec(2.2,-2.7,-1.8)))
holoAng(44,holoEntity(41):toWorld(ang(0,0,90)))
holoScaleUnits(44,vec(4.8,0.075*12,0.05*12))
holoModel(44,"cube")
holoMaterial(44,"lights/white001")
holoParent(44,41) holoColor(44,vec(0,0,0))

holoCreate(45)
holoPos(45,holoEntity(41):toWorld(vec(0,-2.7,0.2)))
holoAng(45,holoEntity(41):toWorld(ang(0,0,90)))
holoScaleUnits(45,vec(3,3,0.05*12))
holoModel(45,"cube")
holoMaterial(45,"lights/white001")
holoParent(45,41) holoColor(45,vec(0,0,0))
  }   
if(Spawn==300) {
#cannon
holoCreate(46)
holoPos(46,E:toWorld(vec(3,50,7)))
holoAng(46,E:toWorld(ang(90,0,0)))
holoScale(46,vec(0.7,0.7,2))
holoModel(46,"cylinder")
holoParent(46,E) holoColor(46,Color2)
holoMaterial(46,Material)     
    
holoCreate(47)
holoPos(47,E:toWorld(vec(-5,59,7)))
holoAng(47,E:toWorld(ang(0,0,90)))
holoScale(47,vec(0.4,0.4,1.4))
holoModel(47,"hq_tube")
holoParent(47,46) holoColor(47,Color2)
holoMaterial(47,Material)     

holoCreate(48)
holoPos(48,E:toWorld(vec(-5,68,7)))
holoAng(48,E:toWorld(ang(0,0,90)))
holoScale(48,vec(0.32,0.32,1.8))
holoModel(48,"hq_tube")
holoParent(48,47) holoColor(48,Color2)
holoMaterial(48,Material)  
        
    Spawn=0 print("LR LandSpeeder: Spawning finished!")
    }
    
    
    
    if(dupefinished()) {reset()}
    
