Stop Server Input Lag

Hello developers,

I am currently developing a game with a custom control system, and it’s extremely hard to account for client exploits while giving the client a smooth experience at the same time. My problem is network latency in live game servers. Of course it runs fine on a local server, but my problem is that moving too fast causes the character to move back and forth since I also move it on the client. I want it to work similar to roblox’s movement system. Move on the client, replicate to the server without input lag replicating back to the client.

I use a simple CAS system that gets keycodes from forward/backward/left/right keycode tables.