相关疑难解决方法(0)

Bizzare"试图在Lua中调用一个表值"

以下代码段:

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)

据我所知,没有任何东西被称呼; 为什么会出现这个错误?

lua for-loop runtime-error next garrys-mod

12
推荐指数
1
解决办法
2万
查看次数

标签 统计

for-loop ×1

garrys-mod ×1

lua ×1

next ×1

runtime-error ×1