Camera move on mouse click

I am rather new to unity and coding myself. Trying to learn it but I am coming across a problem. The question I have may have been answered in another location. Sorry if this is a repeat question.

The game I am making to try things out in is a naval type game. The character is a battleship. What I am trying to do right now is make the camera look at the mouse when the right mouse button is clicked. However I want the turrets to follow the mouse.

I tried to built in mouselook script and played with it a little, but its not giving the results I am looking for.

Why not just take the standard mouselook script and add something like:

if(Input.GetMouseButtonDown(1))
{
//rest of script here
}

all you need to get it to do is check if the right mouse button is held; then run the mouselook code.

I tried putting that code you suggested in, but it is giving me a compiler error. I tried using it in different places of the code but it is still giving me an error. I am not very code literate.