GameOver function

Hi there,
i want to write a function, where it should load another scene, when my game is GameOver.
so i wrote my function but my unity console prints the message “Assets/Scripts/Ball.js(41,10): BCE0044: expecting (, found ‘GameOver’.”

My scripts looks like this:

private var score : int = 0;
public var scoretext : UnityEngine.UI.Text;

function Start () {
	GetComponent.<Rigidbody>().velocity.x = -10;
	GetComponent.<Rigidbody>().velocity.y = 10;
	scoretext.text= "Score: 0";
}

function Update () {
	if(transform.position.y < -15) {
		GameOver();
	}
}

function OnCollisionEnter(col : Collision) {
	if(col.collider.name == "Brick") {
		Destroy(col.gameObject);
		score += 10 ;
		scoretext.text = "Score: " + score;
		print("collided with brick");
}

function GameOver() {
	Application.LoadLevel("Menu");
}
}

Can anyone tell me whats wrong there?
Thanks for answers!

You had ending curly braces out of place, the one at the bottom is misplaced and you didn’t end an if statement in OnCollisionEnter.

Use this:

private var score : int = 0;
public var scoretext : UnityEngine.UI.Text;

function Start () {
	GetComponent.<Rigidbody>().velocity.x = -10;
	GetComponent.<Rigidbody>().velocity.y = 10;
	scoretext.text= "Score: 0";
}

function Update () {
	if(transform.position.y < -15) {
		GameOver();
	}
}

function OnCollisionEnter(col : Collision) {
	if(col.collider.name == "Brick") {
		Destroy(col.gameObject);
		score += 10 ;
		scoretext.text = "Score: " + score;
		print("collided with brick");
	} // YOU WERE MISSING A ENDING CURLY BRACE
}

function GameOver() {
	Application.LoadLevel("Menu");
}
// Removed extra ending curly here, put one above as noted.