How to change the gravity of movement via scripting?

Hi, I have the following scripts for flying in the game, How can i change the gravity of player movement to a specific number via scripting?(I want it for stop movement very smoothly), thankful

var speed = 60.0;

private var moveDirection = Vector3.zero;

function FixedUpdate() 
{
    // Calculate the move direction
    moveDirection = new Vector3(Input.GetAxis("Horizontal"),0, Input.GetAxis("Vertical"));
    moveDirection = Camera.main.TransformDirection(moveDirection);
    moveDirection *= speed;
    // Move the controller
    var controller : CharacterController = GetComponent(CharacterController);    
    controller.Move(moveDirection * Time.deltaTime);
}

Instead of using

controller.Move(moveDirection * Time.deltaTime);

try using

lastMove = Vector3.Lerp(lastMove, moveDirection * Time.deltaTime, Time.deltaTime * 10)
controller.Move(lastMove);

lastMove should be a private script variable so it gets remembered between frames.

The 10 at the end should be changed to a 'smoothing' value that you can set up in the inspector.