Fps player control movement script

Hi there I’m a starter in unity and i came across a problem. Well first of all i dont code all that good, and second i can’t get my movement to to follow my camera. Like if i press W i want it to go forward but if i turn the camera i want it to follow that direction. (catch my drift?) Here is my script code

public var MoveSpeed :float = 50;
public var jumpSpeed : float = 55;
public var MoveDirection = Vector3.zero;
public var Gravity :float = 45;
public var grounded : boolean = false;

function Start (){
}

function Update () {
    if( grounded ){
        MoveDirection = new Vector3(Input.GetAxis("Horizontal"), 0 , Input.GetAxis("Vertical"));
        MoveDirection = transform.TransformDirection(MoveDirection);
        MoveDirection *= MoveSpeed ;
    }
    if( grounded ) {
        if(Input.GetKey(KeyCode.Space)){
            MoveDirection.y = jumpSpeed;
        }
    }
    MoveDirection.y -= Gravity * Time.deltaTime;
    var Controller = GetComponent(CharacterController);
    var Flags = Controller.Move( MoveDirection * Time.deltaTime);
    grounded = (Flags & CollisionFlags.CollidedBelow) !=0;
}

You can do that with a few changes: add the variable turnSpeed and modify the beginning of the Update function:

...
var turnSpeed: float = 60;

function Update(){
    transform.Rotate(0, turnSpeed*Input.GetAxis("Horizontal")*Time.deltaTime, 0);
    if( grounded ){
        MoveDirection = new Vector3(0, 0, Input.GetAxis("Vertical"));
        MoveDirection = transform.TransformDirection(MoveDirection);
        MoveDirection *= MoveSpeed;
    }
    ...