Resouce script help

Ok, i have this script:

    function OnGUI(){

     if
     (GUI.Button(Rect(90,10,150,40),"Work")){
     print(Construction.Wood);
     Construction.Wood += 10;

     } 
}

This mean that when i pres the button it add 10 Wood.

But is there posible to add 10 wood until I tell it to stop? (I want also to remain the button)

If you want something to happen repeatedly while the user holds down that button, use GUI.RepeatButton(). If you are looking for a toggle button (click once -> button stays enabled and wood is produced. click again -> button gets disabled), use GUI.Toggle().

Perhaps something along the lines of:

var addingWood : boolean = false; //flag to set if we are adding wood

function OnGUI()
{
     if(GUI.Button(Rect(90,10,150,40),"Work"))
     {
        if(!addingWood)
        {
            InvokeRepeating("addWood",0.0,1.0); // add wood each second
            addingWood = true;
        }
     } 
}

function Update()
{
    if(someConditionToStopAddingWood())
    {
        CancelInvoke("addWood");
        addingWood = false;
    }
}

function addWood()
{
    print(Construction.Wood);
    Construction.Wood += 10;
}

thanks a lot! it is very helpfull