UCE0001: ';' expected. Insert a semicolon at the end. Help

I’m really new to coding but I’ve got to start somewhere but this error message comes up and I know its probably easy to sort out. It’s for a simple flashlight.

function Update () {

 if (input.GetKeyDown("f")) {
	 
	 if(light.enabled == true)
	    light.enabled = false
		else
		
		light.enabled = true}
}
}

You need a semicolon at the end of each statement:

function Update() {
	if (Input.GetKeyDown("f")) {
		if(light.enabled == true) {
			light.enabled = false;
		}
		else {
			light.enabled = true;
		}
	}
}

You’ll also need to capitalize class names, such as Input.

Organized code is much easier to read, discuss, maintain, and debug. A little trouble upfront can save huge headaches later.

If you want to be a bit fancier, you can toggle a boolean like this:

function Update() {
	if (Input.GetKeyDown("f")) {
		light.enabled = !light.enabled;
	}
}