Problem With Close Door
Problem With Close Door
when I click on a door with the action 100
al of this error, and the door opens, drag the char inside her more when the char leaves the door not closing.
someone help me please?
The script below my closingdoor.lua
BR> 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:
[7:22:41.856] [Error - MoveEvents Interface]
[7:22:41.859] data/movements/scripts/closingdoor.luanStepOut
[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>
Problem With Close Door
when I click on a door with the action 100
al of this error, and the door opens, drag the char inside her more when the char leaves the door not closing.
someone help me please?
The script below my closingdoor.lua
BR> 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:
function onStepOut(cid, item, position, fromPosition)
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