Way to pause/unpause, or stop/start mouselook script?

I wrote a script to pause the game when the esc key is hit. This includes the Time.timeScale being set to 0 when paused as well as AuidoListener.pause being set true when the key is hit, and the opposite values in order to unpause it. When it is paused however, I also want the character to stop being able to look around (which I figure disabling mouselook would take care of) So that my menu options when paused can be clicked on without the character looking around while the selection is trying to be made.

You need to disable the mouselook script with something similar to below (from a similar question):

Static var Dialog : Boolean = false;

Then put this inside your update function:

      GameObject.Find("First Person Controller").GetComponent("MouseLook").enabled = false;            
      GameObject.Find("Main Camera").GetComponent("MouseLook").enabled = false;      

      GameObject.Find("First Person Controller").GetComponent("MouseLook").enabled = true; 
      GameObject.Find("Main Camera").GetComponent("MouseLook").enabled = true;      

Then just toggle the Dialog variable when the game is paused and unpaused.

So after looking around, I was able to find somewhat of a solution. However, even with the following code, the player can still rotate around the x-axis which I've yet to find a solution to.

GetComponent("MouseLook").enabled = !GetComponent("MouseLook").enabled;