Giving a SteamID64 a number

Basically, I want to give a SteamID64 a number. I know, it seems useless- but trust me, I need it.

76561197960279927 => 1
76561197960287930 => 2

How would I go about doing this?

What is the usage of this?

If I had to guess, you’re suffering from the XY problem
Can you give a clearer backstory as to what you’re trying to do?

They’re already numbers, why do you need different numbers? If you need to fit them into some small integer format you can just subtract some big number, the first few digits are the same for every id

Save it into sqlite and assign them an id, then when they connect load it again

Do you automatically want to create an ID for a user or something?

you can use mysql for this, but your question isn’t very clear.

Regardless, that’s the point of SteamID64. It’s literally a constant ID for the player.

If you want to get a SteamID in a lua number, you probably already know that you can’t use SteamID64 because it needs 64 bits, and lua’s numbers (doubles) have only 53(?) bits. What you can use is

Player:AccountID, which is just 32 bits.


Since Lua cannot handle unsigned 64 bit integers (Which is what SteamID64 SHOULD be), Garry’s Mod treats them as strings. This doesnt really mean anything but if you absolutely need a number you should look at converting it to a 32 bit integer or redesigning whatever you are doing to work with SteamID64 strings.

As everyone else has said, the SteamID for every play is not going to change. Use that to your advantage.