• 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!
  • 2026 staff recruitment is open! Check it out and consider applying!

Lua Rope an old problem

justikar

Active Member
Joined
Oct 28, 2013
Messages
149
Reaction score
35
i have the following error, when i use rope on itself, or itens, objcts in bp..I saw some assunts related to rope. lua but not a solution.
im using avesta 7.6 0.6.3

data/actions/scripts/tools/rope.lua:eek:nUse
Description:
(luaGetThingFromPos) Tile not found

Code:
function onUse(cid, item, frompos, item2, topos)
    newPos = {x = topos.x, y = topos.y, z = topos.z, stackpos = 0}
    groundItem = getThingfromPos(newPos)
    if (isInArray(ROPE_SPOT, groundItem.itemid) == TRUE) then
        newPos.y = newPos.y + 1
        newPos.z = newPos.z - 1
        doTeleportThing(cid, newPos)
    elseif (isInArray(OPENED_HOLE, groundItem.itemid) == TRUE or isInArray(OPENED_TRAP, groundItem.itemid) == TRUE or isInArray(DOWN_LADDER, groundItem.itemid) == TRUE) then
        newPos.y = newPos.y + 1
        downPos = {x = topos.x, y = topos.y, z = topos.z + 1, stackpos = 255}
        downItem = getThingfromPos(downPos)
        if (downItem.itemid > 0) then
            doTeleportThing(downItem.uid, newPos)
        else
            doPlayerSendCancel(cid, "Sorry, not possible.")
        end
    else
        return FALSE
    end
    return TRUE
end
 
Last edited:
Try checking for inventory after onUse.

Code:
function onUse(cid, item, frompos, item2, topos)
if topos.x == 0xFFFF then
  return TRUE
end
newPos = {x = topos.x, y = topos.y, z = topos.z, stackpos = 0}
groundItem = getThingfromPos(newPos)
if (isInArray(ROPE_SPOT, groundItem.itemid) == TRUE) then
newPos.y = newPos.y + 1
newPos.z = newPos.z - 1
doTeleportThing(cid, newPos)
elseif (isInArray(OPENED_HOLE, groundItem.itemid) == TRUE or isInArray(OPENED_TRAP, groundItem.itemid) == TRUE or isInArray(DOWN_LADDER, groundItem.itemid) == TRUE) then
newPos.y = newPos.y + 1
downPos = {x = topos.x, y = topos.y, z = topos.z + 1, stackpos = 255}
downItem = getThingfromPos(downPos)
if (downItem.itemid > 0) then
doTeleportThing(downItem.uid, newPos)
else
doPlayerSendCancel(cid, "Sorry, not possible.")
end
else
return FALSE
end
return TRUE
end
 
Back
Top