adding a timer to game such that the time can be increased through points

i’m making a free runner game where the runner carries an object.
i want to add a self destruct timer to this object such that the time would increase if the runner collects a coin.

void Update()
{
timeLeft -= Time.deltaTime;

            if(timeLeft < 0)
            {
                destroy();
            }
        }

void OnCollisionEnter(Collision hit) {
  if(hit.gameObject.tag=="coin")
      timeLeft+=extraTime;
  
}

make a coin objects and check the isTrigger [_] box in the inspector then add a new tag to them call it “Coin”

then add the following script to your runner

var timer : float;
var GameOver : boolean;

function Start ()
{
    GameOver = false;
    timer = 10;
}

function Update ()
{
    timer -= Time.deltaTime;

    if (timer <= 0)
    {
        //do here the self destruct thing (i made a Restart after 1 second you can change)
        Restart();
        GameOver = true;
    }
}

function Restart ()
{
    yield WaitForSeconds (1);
    Application.LoadLevel(0);
}

function OnGUI ()
{
    if (GameOver == ture)
    {
        GUI.Label(Rect (Screen.width / 2, Screen.hieght / 2, 250, 100), "Game Over");
    }
}

function OnTriggerEnter (coin : Collider)
{
    if (coin.tag == "Coin")
    {
        //Change the number of how much time you wanna add when you collect the coin
        timer += 2;
        coin.Destroy;
    }
}