2
我试图从值中获取表键名。 tostring
只返回table: XXXXXXXXX
从值获取表键名
我尝试了一些功能,但没有任何工作。
config = {
opt1 = "etc..."
}
players = {}
function openMenu(playerName, configTable)
players[playerName] = Something to get Table Key...
-- read the table and create a gui not yet made
end
而接下来,如果我这样做:
print(players[playerName])
我想这样的输出:
"config"
PS:这需要用表的表工作(myTable的= {配置= {}}) –
可能重复[ Lua从值中找到一个键值](http://stackoverflow.com/questions/7925090/lua-find-a-key-from-a-value) – ryanpattison
不,它不是,我发现如何 –