How do you only Instantiate only once when pressing a button once?

Hi

Can anyone help me with this problem please? How do you only Instantiate a gameobject only once when pressing a button once? As the example below will instantiate a gameobject every time that a specific button is pressed. Thank you for your help.

var NPC_Guard : GameObject;

function Update () {

if(shoot.isDestroyed2 == true && Input.GetButtonDown("Fire1")){

	bullsEyeTARGET2.renderer.enabled = false;
	NPC_Guard = Instantiate(NPC_Guard, NPC_RespawnPoint1.transform.position, NPC_RespawnPoint1.transform.rotation);
	NPC_Guard = Instantiate(NPC_Guard, NPC_RespawnPoint2.transform.position, NPC_RespawnPoint2.transform.rotation);

}

}

How about add a local boolean variable, initialized to false, that is set to true when you press the button the first time and check the variable in your if statement.

@mweldon is totally right, so it deserves a +1. It’s a very easy task, indeed; he have only pointed you to this:

var NPC_Guard : GameObject;
var lock = false;

function Update () {
if(shoot.isDestroyed2 == true && Input.GetButtonDown("Fire1") && lock == false){
    lock = true;
    bullsEyeTARGET2.renderer.enabled = false;
    NPC_Guard = Instantiate(NPC_Guard, NPC_RespawnPoint1.transform.position, NPC_RespawnPoint1.transform.rotation);
    NPC_Guard = Instantiate(NPC_Guard, NPC_RespawnPoint2.transform.position, NPC_RespawnPoint2.transform.rotation);

}
}