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 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