Using If Statements in a function OnGUI

So it there a way that I can use an “if” statement in a GUI function. Because I tried to and it errors.

var powerjumpG : Texture2D;
powerjumpTF = false;
function Update () 
{
}

function OnGUI ()
{
	if(powerjumpTF)
	{
		GUI.Box (Rect (965, 10, 50, 50), powerjumpG);
	}
}

Basically I wan’t to hide that GUI.box until powerjumpTF is true. Is there another way to do this?

They work fine in OnGUI. Must be some other problem. what’s the error?

Found the problem, i’ll edit first post and highlight the spot… xD

static var powerjumpTF = false;

wasn’t a variable yet.