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

action rope

Dogrinha

New Member
Joined
Oct 6, 2019
Messages
206
Solutions
1
Reaction score
2
Hello, I am trying to make the player can climb the hole even with another player on top, does anyone have this functional script? use tfs 0.4





LUA:
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 or groundTile.itemid == 8278 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
 
Solution
Hello, I am trying to make the player can climb the hole even with another player on top, does anyone have this functional script? use tfs 0.4





LUA:
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 or groundTile.itemid == 8278 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 =...
Hello, I am trying to make the player can climb the hole even with another player on top, does anyone have this functional script? use tfs 0.4





LUA:
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 or groundTile.itemid == 8278 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
try
XML:
<action itemid="2120" event="script" value="tools/rope.lua"/>
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
also add this
XML:
<action itemid="430" event="script" value="other/teleport.lua"/>
LUA:
local UP_FLOORS = {1386, 3678, 5543, 8599, 10035, 13010}
local FIELDS = {1497, 1499, 11095, 11096}
local DRAW_WELL = 1369

function onUse(cid, item, fromPosition, itemEx, toPosition)
    if(item.itemid == DRAW_WELL and item.actionid ~= 100) then
        return false
    end

    local check = false
    fromPosition.stackpos = STACKPOS_GROUND
    if(isInArray(UP_FLOORS, item.itemid)) then
        fromPosition.z = fromPosition.z - 1
        fromPosition.y = fromPosition.y + 1
        if(doTileQueryAdd(cid, fromPosition, 38) ~= RETURNVALUE_NOERROR) then
            local field = getTileItemByType(fromPosition, ITEM_TYPE_MAGICFIELD)
            if(field.uid == 0 or not isInArray(FIELDS, field.itemid)) then
                fromPosition.y = fromPosition.y - 2
            else
                check = true
            end
        end
    else
        fromPosition.z = fromPosition.z + 1
    end

    if(not check and doTileQueryAdd(cid, fromPosition, 38) ~= RETURNVALUE_NOERROR) then
        local field = getTileItemByType(fromPosition, ITEM_TYPE_MAGICFIELD)
        if(field.uid == 0 or not isInArray(FIELDS, field.itemid)) then
            return false
        end
    end

    local pos, dir = getCreaturePosition(cid), SOUTH
    if(pos.x < fromPosition.x) then
        dir = EAST
    elseif(pos.x == fromPosition.x) then
        if(pos.y == fromPosition.y) then
            dir = getCreatureLookDirection(cid)
        elseif(pos.y > fromPosition.y) then
            dir = NORTH
        end
    elseif(pos.x > fromPosition.x) then
        dir = WEST
    end

    doTeleportThing(cid, fromPosition, false)
    doCreatureSetLookDirection(cid, dir)
    return true
end
in your items just add
XML:
 <item id="430" article="a" name="sewer grate" />
    <item id="431" name="stone floor" />
    <item fromid="432" toid="433" name="stairs">
        <attribute key="floorchange" value="down" />
    </item>
for a hole using items id 5731 for example try like this
XML:
  <item id="5731" article="a" name="hole">
        <attribute key="floorchange" value="down" />
    </item>
 
Last edited:
Solution
Back
Top