Making a "Player" sprint - Different opinions?

Hey there, so I'm sitting creating a Player controller, and have been messing around with it for a while. One thing i noticed is that you can make a sprint script very different from others. I succeeded in making my Player sprint at a certain pace, but I cant get him to return to his normalspeed again for some reason. Can someone tell me what I'm doing wrong?

var speed = 10.0;

var normalSpeed = 10.0;

var maxSpeed = 30.0;

var jumpSpeed = 10.0;

var gravity = 30.0;

private var moveDirection =;

function FixedUpdate () {

var controller : CharacterController = GetComponent(CharacterController);

if(controller.isGrounded) {

moveDirection = Vector3(Input.GetAxis("Horizontal"),0,Input.GetAxis("Vertical"));

moveDirection = transform.TransformDirection(moveDirection);

moveDirection *= speed;

if (Input.GetButton("Sprint")){ if (speed <= maxSpeed){ speed ++; }} if (Input.GetButtonDown("Sprint")){ if (speed >= normalSpeed){ speed --; }}

if (Input.GetButton ("Jump")) {

moveDirection.y = jumpSpeed; } }

moveDirection.y -= gravity * Time.deltaTime;

controller.Move(moveDirection * Time.deltaTime); }

You are looking if Button sprint is pressed to decrease speed. You want to look if the is NOT pressed so you check for:

if (!Input.GetButton("Sprint"))

instead of:

if (Input.GetButtonDown("Sprint"))

Also please use the code formatting to make your code more readable.