unity say's: expecting :, found '='.

i want to make a character controller, but unity sayd that the script has an error here’s the script:

var walkSpeed: float = 7; 
var crouchspeed: float = 3; 
var runspeed: float = 15; 

private var chMotor: CharacterMotor;
private var ch: CharacterController;
private var tr: Transform;
private var height: float;


function Start(){

chMotor = GetComponent(CharacterMotor);

tr = transform;

ch = GetComponent(CharacterController);

height = ch.height;

}

function Update(){

var h = height;

var speed = walkspeed;


if(ch.isGrounded && Input.GetKey("left shift") || Input.GetKey("right shift"));{
speed = runspeed

}

if(Input.GetKey("left control"));{
h = 0.5 * height;
speed = crouchspeed; 

{


chMotor.movement.maxForwardSpeed = speed; 
var lastHeight = ch.height; 
ch.height = Mathf.Lerp(ch.height,h,5*Time.deltaTime);
tr.position.y +=(ch.height-lastHeight)/2;
}

You’ve put ; on the end of the if statements which shouldn’t be there. You’ve also missed the ; on line 31, and there is a bracket facing the wrong way on line 39.

Ok thx for the fast answer, i will try to use it (in the evening) and than i write the result, but thx on here, i hope you show my next answer and help me tomorrow or evening… see u soon