• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

Windows Problem With Close Door - BR

eduwx

New Member
Joined
Feb 7, 2010
Messages
11
Reaction score
0
Problem With Close Door

[7:22:41.856] [Error - MoveEvents Interface]
[7:22:41.859] data/movements/scripts/closingdoor.lua:eek:nStepOut
[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
 
I have the same problem please help

- - - Updated - - -

here's got the solution



closingdoor.lua:


function onStepOut(cid, item, position, lastPosition)
if(getTileInfo(position).creatures > 0) then
return true
end

local newPosition = {x = position.x + 1, y = position.y, z = position.z}
local query = doTileQueryAdd(cid, newPosition)
if(query == RETURNVALUE_NOTENOUGHROOM) then
newPosition.x = newPosition.x - 1
newPosition.y = newPosition.y + 1
query = doTileQueryAdd(cid, newPosition) -- repeat until found
end

if(query == RETURNVALUE_NOERROR and query == RETURNVALUE_NOTENOUGHROOM) then
doRelocate(position, newPosition)
end

position.stackpos = -1
local i, tileItem, tileCount = 1, {uid = 1}, getTileThingByPos(position)
while(tileItem.uid ~= 0 and i < tileCount) do
position.stackpos = i
tileItem = getTileThingByPos(position)
if(tileItem.uid ~= 0 and tileItem.uid ~= item.uid and isMovable(tileItem.uid)) then
doRemoveItem(tileItem.uid)
else
i = i + 1
end
end

local itemInfo = getItemInfo(item.itemid)
doTransformItem(item.uid, itemInfo.transformUseTo)
return true
end

function onStepOut(cid, item, position, lastPosition)
local itemInfo = getItemInfo(item.itemid)
doTransformItem(item.uid, itemInfo.transformUseTo)
return true
end
 
Back
Top