Lua中缺少}。

我遇到了一个Lua脚本的问题,它表示在第46行缺少“ } ”,我缺少什么呢?我在代码中标记了它,有人有线索吗,可能是简单的事情吧?

local function Peacekeeper_OnCheckArea(creature)
    for k, player in pairs(GetPlayersInMap(creature:GetMapId())) do
        if(player) then
            if (player:GetAreaId() == creature:GetAreaId()) then
                local point = player:GetX(), player:GetY()  --<-- Line 46**
                if(isInArea(point)) then
                    player:SetPvP(false)
                else
                    player:SetPvP(true)
                end
            end
        end
    end
end
点赞
用户16429
用户16429

你的 local point 应该被赋值为一个表格。就像这样:

local point = { player.GetX(), player.GetY() }
2014-09-03 21:03:27