HELP!! unexpected token: If

this is my code:

#pragma strict
var store = false;
static var click = 0;
var money = 500;
function Start () 
{

}

function Update () 
{
if (Input.GetKeyDown (KeyCode.Escape))
{
store = true;
}
if (store == true)
{
storeopen();
}
}

function storeopen () 
{
if (GUI.Button(Rect(10,10,50,50),"Seeder"));
{
if (money == 100);
{
money : 100};

yield WaitForSeconds (2);
money = 900;
}

dont know whats wrong
any help will be good :slight_smile:

The fix:

if (GUI.Button(Rect(10,10,50,50),"Seeder"));

if (money == 100);

Remove the semicolons after the If. That should remove this error.

BTW, @Positive7 is quite right. OnGUI() functions cannot be called from outside OnGUI(). Do not worry. Replace the Update() with OnGUI() because IMO, OnGUI is basically called more times than Update is.