Using if/else statements in GUI

HI, I have a GUI script which has a line

if (GUI.Button (Rect (20,70,80,20), "Weapon 2")) {
Target.SelectWeapon(1);

Then i have another script with a

static var MyScoreCounter : int = 10;

line. How do I use if/else statements to make the button call out the function Target.SelectWeapon(1); if my MyScoreCounter is more than a certain value, else do nothing?

Use either:

if (GUI.Button (Rect (20,70,80,20), "Weapon 2") && MyScoreCounter > 20) {
    Target.SelectWeapon(1);
}

or:

if (GUI.Button (Rect (20,70,80,20), "Weapon 2")) {
    if (MyScoreCounter > 20) {
        Target.SelectWeapon(1);
    }
}

depending on how you want to lay it out