Gui button runs the code without pressing

When i run my code and the GUI game over screen appears the GUI button that should restart the game clicks itself.
void OnGUI() {

        if (gameOver) {
            GUI.backgroundColor = Color.clear;
            GUIStyle myStyle = new GUIStyle();
			myStyle.alignment = TextAnchor.MiddleCenter;
			myStyle.fontSize = 70;
			myStyle.normal.textColor = Color.white;

			GUIStyle myStyle1 = new GUIStyle();
			myStyle1.alignment = TextAnchor.MiddleCenter;
			myStyle1.fontSize = 40;
			myStyle1.normal.textColor = Color.white;

			GUI.Box (new Rect (0, 0, Screen.width, Screen.height), boi);
            GUI.matrix = Matrix4x4.TRS(new Vector3(GUIsF.x, GUIsF.y, 0), Quaternion.identity, GUIsF);
            GUI.Label (new Rect (0, -200, Screen.width, Screen.height), "Game Over!", myStyle);
            GUI.matrix = Matrix4x4.TRS(new Vector3(GUIsF.x, GUIsF.y, 0), Quaternion.identity, GUIsF);
            GUI.Button (new Rect (670, 300, RestartBTN.width, RestartBTN.height), RestartBTN);
			{
                gameOver = false;
            }


			if(Input.GetKeyDown(KeyCode.Mouse0))
				{
                
            }

		}

	}

Uhm, why shouldn’t it run the code every time? you just placed it inside of OnGUI. You have to use an if statement and check the return value of the Button method:

         if (GUI.Button (new Rect (670, 300, RestartBTN.width, RestartBTN.height), RestartBTN))
         {
             gameOver = false;
         }