GetKeyDown Script problem.

The problem i have is that i do not know how to make it so that the Z key will only work after getting a certain power up i started with the scfript but got stuck, can any one help me?

var bullet: Rigidbody;
var Zbutton =false;

function Update () {    
    if(Input.GetKeyDown("Z") ){
    var tempBullet: Rigidbody;  
    tempBullet = Instantiate(bullet, transform.position, transform.rotation);
    }
}
function OnTriggerEnter(otherObject: Collider){
    if(otherObject.gameObject.tag == "KillallPU"){
        Zbutton =true
    }
}

Thanks for the help :D

You were almost there.

var bullet: Rigidbody;
var zButton : boolean =false;

function Update ()
{    
   if( zButton && Input.GetKeyDown("Z") )
   {
      var tempBullet : Rigidbody;  
      tempBullet = Instantiate(bullet, transform.position, transform.rotation);
   }
}

function OnTriggerEnter(otherObject: Collider)
{
   if(otherObject.gameObject.tag == "KillallPU")
   {
      zButton = true;
   }
}

This assumes that you've tagged your powerup as "KillallPU" and that you never want it to expire. The powerup isn't destroyed at the moment either, so even if you set the powerup to expire, it could be refreshed by walking back into the powerup.

Hope this helps - comment back if you were after more than what you described.