how to make time limit with javascript?

hi im making a simple game were player must get to a green zone to win i need a timelimit script so that if he fails to reach the green zone with in the time limit say 1 minute its game over

You may have to combine answers from different searches to get what you are looking for. One search may be for “unity countdown timer” and another could be something like “unity game over”. Combine these two and you have your answer.

Also, this link is great for any searches you have to do for Unity: Programmable Search Engine

The link that merry_christmas presented you with has the answer though.

var timer : var = 0;
var timeLimit : var = 60; // This is the time limit

function Update(){
   timer+=Time.deltaTime;
   if (timer >= timeLimit){
      **enter game over code here**
   }
}

Everyone needs to start somewhere when learning to program but this is a very simple if statement that you would learn at the very beginning of a CS class or online tutorial on programming basics. I recommend something like this to get the jist of programming before jumping into making a game. If you want specific unityscript tutorials, this is the first thing that popped up when doing a search: http://unityscript.com/

function Update()
{

yield WaitForSeconds (5);

}

The easiest, on my opinion…

Just in case: Unity - Scripting API: WaitForSeconds

Or a co-routine:

public float totalTime;

public Ienumerator Timer()
{
    yield return new WaitForSeconds(totalTime);

    //game over man
}