Need help with disabiling keyboard inputs.

function Update (){
if (Input.GetKeyDown(“1”)){
healthPot ();
}

function healthPot (){
health += healthPotion;
healthPotionAmount --;
Debug.Log( healthPotionAmount + " health potion reamaining.");

}

I want to make it so when the amount of health potions reach 0, it will disable the ability to use the keyboard input, or something close to that.

Don’t disable the ability to press key, but in your function you have to do something like:

function healthPot (){ 
  if(healthPotionAmount > 0) {
    health += healthPotion; 
    healthPotionAmount --; Debug.Log( healthPotionAmount + " health potion reamaining.");
  } else {
    //play sound or whatever to let user know there is no pots left
  }

}