ShowCursor not working on Pause

Hello, I have this script. When the player presses escape, the game pauses. The GUI works and everything, but the cursor won’t. At the start of the game, you can see the cursor. Then when you press escape it starts working. Also, when you click it sometimes reappears. Can someone please help?

Script - var doWindow3 = true;private var leafOffset;private var frameOffset;priv -

first of all this line should have one more }

                pauseGame = !pauseGame;

and i think your problem is that the above is a toggle the !pauseGame is setting pauseGame to what its not ! means not in javascript so you should get rid of line 123 to 129

if (GUILayout.Button("Resume Game")){
                Time.timeScale = 1;
        pauseGame = false;
        GameObject.Find("Main Camera").GetComponent(MouseLook).enabled = true;
        GameObject.Find("Player").GetComponent(MouseLook).enabled = true;
        showGUI = false;