@name AirPlane Control 
@inputs Pod:wirelink 
@persist Prop:entity Fire Prop2:entity Props:array ThrustW ThrustA ThrustS ThrustD ThrustDown ThrustUp 
@persist
@outputs Gun Slot1
@model models/props_lab/reciever01a.mdl
runOnTick(1)
timer("delete",10000)
#Variables
E= entity()
P= owner()
EW= entity():isConstrainedTo()
LS= owner():lastSaid()
if(first()){
    E:setMass(1)
    EW:setMass(100)
    EW:propGravity(100)
    E:propGravity(100)
    print("Slot1 = Alt")
    print("Gun = Mouse1")
    print("Rockets(Spawned At Expression2) = Mouse2")
    print("Re-Read in console (~)")
    hint("We Recommended Not using models/xqm/jetbody3.mdl",7)
    hint("Please Weld Expression2 to Aircraft",70)
    timer("weightless",10000)
    }
if(clk("weightless")){
    EW:setMass(100)
    timer("Weightless",10000)
}
#Controls
if(Pod["W",number]==1){
    ThrustW=1}
if(Pod["A",number]==1){
    ThrustA=1}
if(Pod["S",number]==1){
    ThrustS=1}
if(Pod["D",number]==1){
    ThrustD=1}
if(Pod["Space",number]==1){
    ThrustUp=1}
if(Pod["Alt",number]){
    ThrustDown=1}
if(Pod["Mouse1",number]==1){
    Gun=1}

if(Pod["W",number]==0){
    ThrustW=0}
if(Pod["A",number]==0){
    ThrustA=0}
if(Pod["S",number]==0){
    ThrustS=0}
if(Pod["D",number]==0){
    ThrustD=0}
if(Pod["Space",number]==0){
    ThrustUp=0}
if(Pod["Alt",number]==0){
    ThrustDown=0}
if(Pod["Mouse1",number]==0){
    Gun=0}
    #Missle Launcher
if(Pod["Mouse2",number]==1 & Pod["Mouse2",number]==1){
            Prop2 = propSpawn("models/props_phx/misc/potato_launcher_explosive.mdl", E:pos()+(vec(0,0,-60)), P:angles(), 0)
    Prop2:setMass(100)
    Prop2:setTrails(10,10,10,"trails/smoke",vec(100,100,100),255)
    Props:pushEntity(Prop)
}
if(clk("delete")&Props:count()){
    Props:shiftEntity():propDelete()
    Props:propDelete()
}
    #ApplyForce
    Prop2:applyForce(P:eye()*99999999)
        if(duped()){
            reset()
        }
if(ThrustW){
    EW:applyForce(EW:forward()*750)    
}
    if(ThrustA){
    EW:applyForce(EW:toWorld(vec(0,-750,0))-EW:pos())    
}

if(ThrustS){
    EW:applyForce(EW:toWorld(vec(-750,0,0))-EW:pos())
}

if(ThrustD){
    EW:applyForce(EW:toWorld(vec(0,750,0))-EW:pos())    
}

if(ThrustUp){
    EW:applyForce(EW:toWorld(vec(0,0,800))-EW:pos())    
}


























