[7:22:41.856] [Error - MoveEvents Interface]
[7:22:41.859] data/movements/scripts/closingdoor.lua:onStepOut
[7:22:41.863] Description:
[7:22:41.865] data/lib/050-function.lua:10: bad argument #1 to 'ipairs' (table e
xpected, got nil)
[7:22:41.870] stack traceback:
[7:22:41.872] [C]: in function 'ipairs'
[7:22:41.875] data/lib/050-function.lua:10: in function 'isInArray'
[7:22:41.879] data/movements/scripts/closingdoor.lua:7: in function <data/move
ments/scripts/closingdoor.lua:1>
quando eu clico em uma porta com a action 100
da este erro ai, e a porta abre, arrasta o char pra dentro dela, mais quando o char sai, a porta nao se fecha.
alguem me ajuda por favor?
abaixo o script meu closingdoor.lua
closingdoor.lua:
if(getTileInfo(position).creatures > 0) then
return true
end
local newPosition = {x = position.x, y = position.y, z = position.z}
if(isInArray(verticalOpenDoors, item.itemid)) then
newPosition.x = newPosition.x + 1
else
newPosition.y = newPosition.y + 1
end
doRelocate(position, newPosition)
local tmpPos = position
tmpPos.stackpos = -1
local i, tmpItem, tileCount = 1, {uid = 1}, getTileThingByPos(tmpPos)
while(tmpItem.uid ~= 0 and i < tileCount) do
tmpPos.stackpos = i
tmpItem = getTileThingByPos(tmpPos)
if(tmpItem.uid ~= item.uid and tmpItem.uid ~= 0 and isMoveable(tmpItem.uid)) then
doRemoveItem(tmpItem.uid)
else
i = i + 1
end
end
doTransformItem(item.uid, item.itemid - 1)
return true
end