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

Rope

Joined
Apr 11, 2015
Messages
106
Reaction score
6
Hello, i am having a problem here with my Rope. When the monster is in the spot to use the rope, i get a console error and the player cant use it.
For exemple: 1566331978741.png

I get this error: 1566332036560.png

The same error if the same player is in the spot and try to use the rope.1566332036560.png
 
Solution
Try this one instead, and always post your TFS version and as much details as you can as Stigma told you.
LUA:
function onUse(cid, item, fromPosition, itemEx, toPosition)
    if(toPosition.x == CONTAINER_POSITION) then
        doPlayerSendDefaultCancel(cid, RETURNVALUE_NOTPOSSIBLE)
        return true
    end

    toPosition.stackpos = STACKPOS_GROUND
    local itemGround = getThingFromPos(toPosition)
    if(isInArray(SPOTS, itemGround.itemid)) then
        doTeleportThing(cid, {x = toPosition.x, y = toPosition.y + 1, z = toPosition.z - 1}, false)
        return true
    elseif(isInArray(ROPABLE, itemEx.itemid)) then
        local hole = getThingFromPos({x = toPosition.x, y = toPosition.y, z = toPosition.z + 1, stackpos =...
5. Incomplete Problem Description:

- Post as much useful information as possible. If the problem is about something on your server, post the server version and client version. Also always post the errors you get and the scripts with the problems.
 
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



open data>actions>script>tools>rope

ctrl c + ctrl v
 
Try this one instead, and always post your TFS version and as much details as you can as Stigma told you.
LUA:
function onUse(cid, item, fromPosition, itemEx, toPosition)
    if(toPosition.x == CONTAINER_POSITION) then
        doPlayerSendDefaultCancel(cid, RETURNVALUE_NOTPOSSIBLE)
        return true
    end

    toPosition.stackpos = STACKPOS_GROUND
    local itemGround = getThingFromPos(toPosition)
    if(isInArray(SPOTS, itemGround.itemid)) then
        doTeleportThing(cid, {x = toPosition.x, y = toPosition.y + 1, z = toPosition.z - 1}, false)
        return true
    elseif(isInArray(ROPABLE, 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

        return true
    end

    return false
end
 
Solution
It has ids already included in your server data\actions\lib\actions.lua
referred to it in this script by ropable and spots
 
Last edited:
Back
Top