They originally accomplished this with an interesting approach to netcode you couldn't do today.
Everything was replicated in the client and server. So you could open Cheat Engine, modify your total $$$ on the client, and it would propagate to the server and everyone else playing.
They only fixed this in 2014 with FilteringEnabled/RemoteFunctions but that was opt-in until 2018 and fully rolled out in 2021 (breaking most classic Roblox games). This also made games much harder to develop.