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

Solved rope bug?

oshrigames

Active Member
Joined
Nov 9, 2012
Messages
222
Reaction score
47
Location
israel
i just got this in my console, any idea what is it?
i got reports from players that the clients crush at the same time.

Code:
Lua Script Error: [Action Interface]
data/actions/scripts/tools/rope.lua:onUse
data/actions/scripts/tools/rope.lua:10: attempt to index local 'tile' (a nil value)
stack traceback:
        [C]: in function '__index'
        data/actions/scripts/tools/rope.lua:10: in function <data/actions/scripts/tools/rope.lua:8>

im using TFS 1.1
and this is the rope.lua that stated in the bug

Lua:
local holeId = {
    294, 369, 370, 383, 392, 408, 409, 410, 427, 428, 430, 462, 469, 470, 482,
    484, 485, 489, 924, 3135, 3136, 7933, 7938, 8170, 8286, 8285, 8284, 8281,
    8280, 8279, 8277, 8276, 8323, 8567, 8585, 8596, 8595, 8249, 8250, 8251,
    8252, 8253, 8254, 8255, 8256, 8972, 9606, 9625, 13190, 14461, 19519, 21536
}

function onUse(player, item, fromPosition, target, toPosition, isHotkey)
    local tile = toPosition:getTile()
    if isInArray(ropeSpots, tile:getGround():getId()) or tile:getItemById(14435) then
        player:teleportTo({x = toPosition.x, y = toPosition.y + 1, z = toPosition.z - 1}, false)
        return true
    elseif isInArray(holeId, target.itemid) then
        toPosition.z = toPosition.z + 1
        tile = toPosition:getTile()
        if tile then
            local thing = tile:getTopVisibleThing()
            if thing:isItem() and thing:getType():isMovable() then
                return thing:moveTo({x = toPosition.x, y = toPosition.y + 1, z = toPosition.z - 1})
            end
        end
        player:sendCancelMessage(RETURNVALUE_NOTPOSSIBLE)
        return true
    end
    return false
end

let me konw if there's anything else that you might need.

thanks
 
It happens with me too.. and it doesn't crash. It happens when a player is in the rope spot (which we should click to use rope). I don't know how to solve.. glad you open a thread.. hope to learn about this too.
 
Lua:
local spotId = {384, 418, 8278, 8592}
local holeId = {
    294, 369, 370, 383, 392,
    408, 409, 427, 428, 430,
    462, 469, 470, 482, 484,
    485, 489, 924, 3135, 3136,
    7933, 7938, 8170, 8286, 8285,
    8284, 8281, 8280, 8279, 8277,
    8276, 8323, 8380, 8567, 8585,
    8596, 8595, 8249, 8250, 8251,
    8252, 8253, 8254, 8255, 8256,
    8972, 9606, 9625
}
function onUse(cid, item, fromPosition, itemEx, toPosition)
    if(toPosition.x == CONTAINER_POSITION) then
        doPlayerSendDefaultCancel(cid, RETURNVALUE_NOTPOSSIBLE)
        return true
    end
    local itemGround = getThingfromPos(toPosition)
    if(isInArray(spotId, itemGround.itemid)) then
        doTeleportThing(cid, {x = toPosition.x, y = toPosition.y + 1, z = toPosition.z - 1}, false)
    elseif(isInArray(holeId, itemEx.itemid)) 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
            doPlayerSendDefaultCancel(cid, RETURNVALUE_NOTPOSSIBLE)
        end
    else
        return false
    end
    return true
end
 
Back
Top