【发布时间】:2014-09-11 22:44:21
【问题描述】:
我想做如下的事情:
local archetype = "melee"
local meleeNames = { x,y,z }
if itemNumber > # [archetype .. "Names"] then
itemNumber = # [archetype .. "Names"]
end
但是,我不确定如何访问该变量,这不是...
[archetype .. "Names"]
谢谢, 古利
【问题讨论】:
-
你不能这样编造句法。如果变量是全局变量,请使用
_G表。但是该变量在您的代码中是本地的,在这种情况下,请阅读Access local variable by name