How would I go on about making a Source Engine-like custom character controller?

I want to remake Source Engine movement in Roblox, but after reading a 5K lines long movement script here https://github.com/ValveSoftware/source-sdk-2013/blob/master/mp/src/game/shared/gamemovement.cpp I simply do not know where to start!
Ive tried making it myself, but the character would get flung or something else would go wrong (I tried manually controlling velocity).

Thanks in advance!

is this C language? maybe the is some converter, just change manually the ambient (Source to roblox) and there u go