I HAVE UPDATED THIS POST FROM THE FIRST POST:

So im trying to make a GUI Image appear when I press F4, I attempted to make a script for this, but it is not working. No errors or anything. Just not working. And I can turn the jobscreen OFF but I cannot turn it ON

DONT PAY ATTENTION TO ANY OF THE STUFF IN FUNCTION ONGUI… THAT IS FOR SOMETHING ELSE.

#pragma strict

public var CurrentMoney : int = 0;
public var Purge : boolean;
public var PurgeTexture1 : Texture2D;
public var jobscreen : GameObject;


function OnGUI () {
	if (Time.timeSinceLevelLoad < 60*15) {
	    Purge = false;
		GUI.Label (Rect (450, 20, 400, 80), " " + Time.timeSinceLevelLoad);
		GUI.Label (Rect (-360, -450, PurgeTexture1.width, PurgeTexture1.height),PurgeTexture1);
		
	}
	else if ((Time.timeSinceLevelLoad > 60*15) && (Time.timeSinceLevelLoad <60*25)) {
	Purge = true;
	GUI.Label (Rect (4,4,400,80), "The Pillage Has Begun");
	}


if (Time.timeSinceLevelLoad >= 60*25) {
	Application.LoadLevel("MainScene");
	Debug.Log("Level reloaded");
	}

	
 if (Input.GetKeyDown(KeyCode.F4)) {
  JobScreenOnAndOff();
  }
}

function JobScreenOnAndOff () {
if (jobscreen.active == false) {
jobscreen.SetActive(true);
}
if (jobscreen.active == true) {
jobscreen.SetActive(false);
}
}

HERE IS A PIC OF THE HEIRARCHY

You mean the object this script attached to is called “jobscreen”? I don’t think that would work since if I’m not mistaken, once the object is not active, it shouldn’t be able to run the code that check for input (F4). So you might want to place the script on another object and set the “jobscreen” variable to point to the “jobscreen” object.

Edit:
Try changing this part of your code:

function JobScreenOnAndOff () {
 if (jobscreen.active == false) {
 jobscreen.SetActive(true);
 }
 else {
 jobscreen.SetActive(false);
 }
 }

I think it’s because the “active” value got change back to false after it was set to true.

Okay, so I fixed my problem. I should have had line 28-31 INSIDE of an Update function so that its constantly checking to see whether its active or not. YAYYYY IT WORKS NOWWWWW

	function Update () {
 if (Input.GetKeyDown(KeyCode.F4)) {
  JobScreenOnAndOff();

  }
}

function JobScreenOnAndOff () {
    if (jobscreen.active == false) {
  jobscreen.SetActive(true);
  Debug.Log("Turned On");
  }
  else {
  jobscreen.SetActive(false);
  Debug.Log("Turned Off");
  }
  }