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.

[editline]10:32PM[/editline]

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

snip

What?

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{
Data1
Data2
}
Player Steamid2{
Data1
Data2
}
}

[editline]10:41PM[/editline]

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

[editline]10:41PM[/editline]

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

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

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

You can use strings as well.

Edit:

Ninja’d.