Automatic counting on a button click

Hi all,
I am trying to write some code that, when a button is pressed, it automatically counts up.
The idea is to only allow this button to be pressed after a certain amount of clicks and continue to count up without any further input.

This is what I have at the moment:

var clicks : GameObject; 
var score : GUIText; 
var clicked : boolean = false; 
var click : float = 0; 
var clickScore : int; 
    
    function Start () { 
    click = 0; }
    
    function Update () { 
    clickScore = click; 
    score.text = "Resources: " + clickScore; 
    }
    
    function OnMouseDown () { 
    click += 1; }

Am I needing a second script that will act as the button that increases the “Resources” on its own?

change OnMouseDown to toggle the ‘clicked’ bool you have defined.
Change your update to:

function UpdatE() {
  if(clicked){
    clickScore++;
  }
  score.text = "Resources: " + clickScore;
}

alternatively, if you want the user to have to click the button a certain number of times to activate it:

var clicks : GameObject;
var score : GUIText;
var clicked : boolean = false;
var click : float = 0;
var threshold : float = 10; // require 10 clicks to activate.
var clickScore : int;

function Start () {
  click = 0; 
}

function Update () {
  if(clicked){
    clickScore++;
  }

  score.text = "Resources: " + clickScore;
}

function OnMouseDown () {
  click += 1; 
  if(click >= threshold){
    clicked = true;
  }
}