did not QUIT when the time is over..

the game did not QUIT when the time is over…please help
this is the code in time.

private var startTime;
private var restSeconds : int;
private var roundedRestSeconds : int;
private var displaySeconds : int;
private var displayMinutes : int;
var customButton : GUIStyle;
public var countDownSeconds : int;
public var timed;

function Awake() {
    startTime = Time.time;
}

function OnGUI () {
    //make sure that your time is based on when this script was first called
    //instead of when your game started

    var guiTime = Time.time - startTime;

    restSeconds = countDownSeconds - (guiTime);

    //display messages or whatever here -->do stuff based on your timer

    if (restSeconds == 60) {
        print ("One Minute Left");
    }

    if (restSeconds == 0) {
        print ("Time is Over");
        if(Time.time == 0 );
        Application.Quit();
}

//GUILayout.EndArea();

        //do stuff here


    //display the timer

    roundedRestSeconds = Mathf.CeilToInt(restSeconds);
    displaySeconds = roundedRestSeconds % 60;
    displayMinutes = roundedRestSeconds / 60; 

timed =String.Format ("{0:00}:{1:00}", displayMinutes, displaySeconds); 

//print(timed);

    text = String.Format ("{0:00}:{1:00}", displayMinutes, displaySeconds); 

    GUI.Label (Rect (300, 25, 100, 30), text, customButton);
}

This section:

if (restSeconds == 0) {
    print ("Time is Over");
    if(Time.time == 0 );
    Application.Quit();
}

needs to be changed to:

if (restSeconds <= 0) {
    print ("Time is Over");
//    if(Time.time == 0 );    // REMOVE THIS
    Application.Quit();
}

I haven’t checked the rest of your code, but that’s definitely a problem. If you’re subtracting very small numbers every frame, it’s very unlikely that they’ll ever equal exactly 0.

Also, Time.time will only equal 0 for the first frame (if at all), and your ifcheck has a semicolon after it, so it would never do anything either!