How would I go about making first person tank controls?

Hey, everyone.

I’ve been wanting to make a game based on those old 3D maze games (like that one old windows screensaver) where you can only move forwards and backwards using W and S, and move the camera left and right using A and D. Also, I’d like the cursor to be free to move around the screen, without moving the camera.

I looked around on the devforum and found someone who made some working tank controls but haven’t been able to make it work with first person:

I’m fairly new to LUA so I’d really appreciate some help with this.