@name Plane
@inputs Pod:wirelink 
@outputs 
@persist  
@trigger 
runOnTick(1)

E = entity():isWeldedTo()

local Seat = Pod["Entity",entity]
local Driver = Seat:driver()
local W = Driver:keyForward()
local A = Driver:keyLeft()
local S = Driver:keyBack()
local D = Driver:keyRight()
local R = Driver:keyReload()
local Mouse1 = Driver:keyAttack1()
local Mouse2 = Driver:keyAttack2()
local Space = Driver:keyJump()
local Shift = Driver:keySprint()
local Active = Driver:isPlayer()
local On = Active

if (W) {
    E:applyAngForce(ang(0,0,-400)*E:mass())
}

if (S) {
    E:applyAngForce(ang(0,0,400)*E:mass())
}

if (D) {
    E:applyAngForce(ang(60,0,0)*3*E:mass())
}

if (A) {
    E:applyAngForce(ang(-60,0,0)*3*E:mass())
}

if (Space) {
    E:applyForce(-E:right()*400*E:mass())
}

if (Shift) {
    E:applyForce(E:right()*100*E:mass())
}
