How to make a button that switches from 3rd person mode to first person mode?

I want to make a gui button with a script when u click it it changes cameras... how do i fix?

As Duck posted to a similiar question you can switch between cameras by setting camera's enabled property true or false.

var cam1 : Camera;

var cam2 : Camera;

function Start() { cam1.enabled = true; cam2.enabled = false; }

function Update() {

if (Input.GetKeyDown(KeyCode.C)) {
    cam1.enabled = !cam1.enabled;
    cam2.enabled = !cam2.enabled;
}

}

next time try searching before posting, I found the reference link by just typing changing cameras into the search field.

reference : Duck