Script help! Mysterious error

I am having trouble with the last few lines of this code, I will post the error (all 4 are the same and point to the same code) and code. It is attached to a gameobjedct with a rigidbody and the mouselook script. It is supposed to move forward and backward in midair.

Here is the code

private var pilot : Rigidbody; var thrustForce = 3;

var invertPitch : boolean = true; var invertYaw : boolean = false; var sensitivity : float = 1000;

function Update () { 
    if (Input.GetKeyDown("w")) 
        SetThrust(5); // other ifs here

    if (Input.GetKeyUp("w")) { 

    if (Input.GetKeyDown("s")) { 

    if (Input.GetKeyUp("s")) { 


function SetThrust ( thrustForce : int) { 
    pilot.constantForce.relativeForce = Vector3.forward * 
                                     thrustForce * sensitivity; 

Here is the error, It occurs whenever you press w or s down or release it.

moonflight.SetThrust (Int32
thrustForce) (at
moonflight.Update () (at

Either pilot isn’t initialized or it doesn’t have a ConstantForce component attached to it.