How to change scenes after score reaches number?

I am using a script to make the level change after a score card reaches 7. This is my script it looks fine to me but when I play the score does not go up and so the level doesn’t change. Please help!!!

#pragma strict
var levelToLoad : String;
static var currentScore : int = 0;
var offsetY : float = 40;
var sizeX : float = 100;
var sizeY : float = 40;
function Start () {
 currentScore = 0;
}
function OnGUI () {
 GUI.Box (new Rect (Screen.width/2-sizeX/2, offsetY, sizeX, sizeY), "Score: " + currentScore);
}
function update()
{
    currentScore -= 0;
    if(currentScore >= 7)
    {
        currentScore = 7;
        Application.LoadLevel("levelToLoad");
    }

Your function “update” is not being called by unity. You need to fix the case of the function name so that U is upper case, then unity will call it once per frame.

Fixed:

#pragma strict
var levelToLoad : String;
static var currentScore : int = 0;
var offsetY : float = 40;
var sizeX : float = 100;
var sizeY : float = 40;

function Start () {
  currentScore = 0;
}

function OnGUI () {
  GUI.Box (new Rect (Screen.width/2-sizeX/2, offsetY, sizeX, sizeY), "Score: " + currentScore);
}

function Update()
{
  currentScore -= 0;
  
  if(currentScore >= 7)
  {
    currentScore = 7;
    Application.LoadLevel("levelToLoad");
  }
}