Object reference not set to any instance of an object

I’m using this code to check if button F1 was pressed, and if it was to make MenuCam the man camera. But I just keep getting the error: Object reference not set to any instance of an object.

var MenuCam : GameObject;
var FPSPlayerCam : GameObject;

function Update(){
	if (Input.GetButtonDown.KeyCode.F1);
		Camera.main.gameObject.active = false;
		MenuCam.active = true;
}

There are few problems in your script
Use this script instead

var MainCam:Camera;

var Cam2:Camera;

function Start(){

MainCam.enabled = true;
Cam2.enabled = false;
}

function Update(){
if(Input.GetKeyDown(KeyCode.F1){
MainCam.enabled = !MainCam.enabled;
Cam2.enabled = !Cam2.enabled;
}
} 

Script is in working condition

If anyone else need the full script here is is:

var FPSCam : Camera;
var MenuCam : Camera;

function Start(){
FPSCam = Camera.main;
FPSCam.enabled = true;
MenuCam.enabled = false;
}

function Update(){
if(Input.GetKeyDown(KeyCode.F1))
FPSCam.enabled = !FPSCam.enabled;
MenuCam.enabled = !MenuCam.enabled;
}

Checked and working. Thanx to deltamish and Seth Bergman.