以下代码段:
for weight, item in itemlist do
weight_total=weight_total+weight
end
Run Code Online (Sandbox Code Playgroud)
在该代码段的第一行导致错误"尝试调用表值".为什么?
Itemlist是权重和字符串表的表,如下所示:
local itemlist = {
{4,"weapon_pistol"},
{2,"weapon_357"},
...
Run Code Online (Sandbox Code Playgroud)
据我所知,没有任何东西被称呼; 为什么会出现这个错误?