Script error about the semicolon.

“Assets/Standard Assets/Scripts/CarLights/Carlights.js(3,4): UCE0001: ‘;’ expected.”

I don’t understand this error at all.

I think that I have all semicolons needed at the right place.

var carlight1 : Light;
var carlight2 : Light;
int number = 0;

function OnEnable(){
	carlight1.light.enabled = false;
	carlight2.light.enabled = false;
}

function OnMouseDown(){

	if (number == 0){
	carlight1.light.enabled = true;
	carlight2.light.enabled = true;
	number + 1;
	}
	else if (number == 1){
	carlight1.light.enabled = false;
	carlight2.light.enabled = false;
	number - 1;
	}
}

Hopefully somebody fixes this script.

var carlight1 : Light;
var carlight2 : Light;
int number = 0;

Looks like you’re mixing languages. Shouldn’t the number declaration be…

var number : int = 0;

?

Also, where you have number - 1 and number + 1 you need to assign those to something. Should be number = number - 1 and number = number + 1, or you can use the shorthand syntax of number -= 1, or number--.