• 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 Problems

HeberPcL

[PowerOT.com.br]
Joined
Aug 21, 2007
Messages
1,294
Reaction score
54
Location
Brazil
GitHub
heberpcl
Lua Script Error: [Action Interface]
data/actions/scripts/tools/rope.lua:onUse
luaGetThingfromPos(). Tile not found

Code:
local holeId = {294, 369, 370, 383, 392, 408, 409, 427, 428, 430, 462, 469, 470, 482, 484, 485, 489, 924, 3135, 3136}
function onUse(cid, item, fromPosition, itemEx, toPosition)
    local groundTile = getThingfromPos(toPosition)
    if groundTile.itemid == 384 or groundTile.itemid == 418 then
        doTeleportThing(cid, {x = toPosition.x, y = toPosition.y + 1, z = toPosition.z - 1}, FALSE)
    elseif isInArray(holeId, itemEx.itemid) == TRUE then
        local hole = getThingfromPos({x = toPosition.x, y = toPosition.y, z = toPosition.z + 1, stackpos = STACKPOS_TOP_MOVEABLE_ITEM_OR_CREATURE})
        if hole.itemid > 0 then
            doTeleportThing(hole.uid, {x = toPosition.x, y = toPosition.y + 1, z = toPosition.z}, FALSE)
        else
            doPlayerSendCancel(cid, "Sorry, not possible.")
        end
    else
        return FALSE
    end
    return TRUE
end

Which error of the script?
 
Last edited by a moderator:
It's generating errors because someone is trying to use rope on a hole which doesn't have a tile below itself, you can just ignore the error.
 
You can change this lines:
Code:
local groundTile = getThingfromPos(toPosition)
if groundTile.itemid == 384 or groundTile.itemid == 418 or groundTile.itemid == 8278 then
To:
Code:
if itemEx.itemid == 384 or itemEx.itemid == 418 or itemEx.itemid == 8278 then
 
No, sorry my idea is bad :P It won't work on tiles where is something on it. Ex. if there is 3 gp on rope spot, then you won't be able to go up ;/ Ignore my post up, its wrong solution &^^
 
Back
Top