What is the best way to make a fps camera in lua?

I’m Trying to make a Fps camera using lua, but every once in a wile it will shake and I’m not sure why. It only happens on the X input not the Y. May have something to do with the X input effecting the players rotation and the Y input is effecting only the camera. I’m trying to make a smooth fps camera that dose not shake If anyone knows how to do this please help me out.

This is what I’ve done in code.