Table name

Is it possible to name a table a variable? Like, im making a gamemode, and i want to have a table of tables, and i want each “subtable” to have a diffrent name, more precisely, a player’s steamid. How can i do this? Obviously ply:SteamID() = {} doesn’t work.


Neither does tostring(ply:SteamID()) = {} work.



I edited my first post. So did you want a table of the players steamids? I’m not sure what you’re asking
i think i get it, you want to be able to call your table like PlayerInfo[1].name Playerinfo[1].steamid

Here is what i want:

Master table{
Player Steamid1{
Player Steamid2{


And i can do: MasterTable[STEAM_1:0_353454235][2]


and if Player Steamid1 was = to that steamid, i would get Data2.

PlayerInfo = {}
PlayerInfo[SteamID] = {}
PlayerInfo[SteamID].Name = “namename”
PlayerInfo[SteamID].Guns = {gun1,gun2}
PlayerInfo[SteamID].Money = 55

like that?

oh you cant use steamid as the array index as its not an integer

player_ids = {}
player_ids[ply:SteamID()] = { “stuff”, “otherstuff” }

What? Lua tables support string keys. That’ll work fine.

You can use strings as well.