Disabling camera movement

using UnityEngine;

using System.Collections;

public class UI : MonoBehaviour {

	public MouseLook mouseLook;

        void Start()
	{
		mouseLook = GetComponent<MouseLook>();
	}

        void Update()
	{
		if(Input.GetKeyDown(KeyCode.E))
		{
			chooseStructure = true;
			mouseLook.enabled = false;
			//GameObject.Find("Player").GetComponent<MouseLook>().enabled = false;
		}
		if(Input.GetKeyDown(KeyCode.Q))
		{
			chooseStructure = false;
			mouseLook.enabled = true;
			//GameObject.Find("Player").GetComponent<MouseLook>().enabled = true;
		}
	}
}

I got this but it doesnt work ;/ when i click E camera still moving.

Okay, now its my script:

using UnityEngine;
using System.Collections;

public class UI : MonoBehaviour {

	public Transform cam;

	public Build build;

	public Health health;
	public Hunger hunger;

	public Inventory item;

	public Rect healthpos;
	public Rect hungerpos;
	public Rect woodpos;

	public Rect cube1pos;
	public Rect cube2pos;
	public Rect cube3pos;
	public Rect cube4pos;

	public Rect warningPos;

	public bool chooseStructure;

	void Start()
	{

	}

	void Update()
	{
		if(Input.GetKeyDown(KeyCode.E))
		{
			chooseStructure = !chooseStructure;
			if(chooseStructure)
			{
				cam.GetComponent<MouseLook>().enabled = false;
			}
			else
			{
				cam.GetComponent<MouseLook>().enabled = true;
			}
		}
	}

	void OnGUI()
	{
		HealthHunger ();
		if(chooseStructure)
		{
			StructureMenu();
		}
		if(build.warning)
		{
			GUI.Label(warningPos, build.warningText);
			InvokeRepeating("WarningOff", 2, 1);
		}
	}

	void HealthHunger()
	{
		GUI.Label (healthpos, "Health:" + health.curHealth + "/" + health.maxHealth);
		GUI.Label (hungerpos, "Hunger:" + hunger.curHunger + "/" + hunger.maxHunger);
		GUI.Label (woodpos, "Wood:" + item.woodCount);
	}

	void StructureMenu()
	{
		if(GUI.Button(cube1pos, "Cube1") && !build.block)
		{
			Debug.Log("Cube1 chosen");
			build.Cube1 = true;
			build.Cube2 = false;
			build.Cube3 = false;
			build.Cube4 = false;
		}
		if(GUI.Button(cube2pos, "Cube2") && !build.block)
		{
			Debug.Log("Cube2 chosen");
			build.Cube1 = false;
			build.Cube2 = true;
			build.Cube3 = false;
			build.Cube4 = false;
		}
		if(GUI.Button(cube3pos, "Cube3") && !build.block)
		{
			Debug.Log("Cube3 chosen");
			build.Cube1 = false;
			build.Cube2 = false;
			build.Cube3 = true;
			build.Cube4 = false;
		}
		if(GUI.Button(cube4pos, "Cube4") && !build.block)
		{
			Debug.Log("Cube4 chosen");
			build.Cube1 = false;
			build.Cube2 = false;
			build.Cube3 = false;
			build.Cube4 = true;
		}
	}

	void WarningOff()
	{
		build.warning = false;
		CancelInvoke("WarningOff");
	}
}

and still nothing … All the time error:

NullReferenceException: Object reference not set to an instance of an object
UI.Update () (at Assets/Scripts/UI.cs:40)

You don’t need to do the void Start() { mouseLook = GetComponent<MouseLook>(); } part. I assume you set the mouseLook script via the editor? in that case you can remove the code in your start method.