How do I limit the x axis on a first person controller?

Im making a helicopter scene, and I need to limit the x and y axis. I did the y axis, and he can only look so far down. Now, I need to know how to make it so he can only look so far to the left and right. I tried changing the minimum and maximum x axis in the main camera and the first person controller. That did nothing tho. any ideas?

Look at how the included MouseLook.js script limits rotation. That's probably the best way to do this.

This has also been asked and answered before. You might want to check-out that thread as well: