Something in my script not working please help

my script doesnt seem to be working can someone please help me im quite new to unity
Heres the part thats not working:

function PauseStop () {

if (Input.GetButton("escape")) {

pause = 1;
Debug.log( "pause1" );
}

else
{

pause = 0;
Debug.log( "pause0" );
}
}

Change GetButton to GetButtonUp

Your code is saying “If the user is holding the pause button then pause = 1 else pause = 0”

You need “When the user presses the pause button set pause to 1 or 0 depending on stuff”

“When the user presses…”: Input.GetKeyDown / GetButtonDown

if ( Input.GetButtonDown("escape") ) {
  if ( pause == 1 ) pause = 0; else pause = 1;
}

Do you have an Input named ‘escape’? You probably mean to use GetKeyDown(KeyCode.Escape).