• 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!
  • If you're using Gesior 2012 or MyAAC, please review this thread for information about a serious security vulnerability and a fix.

rope script help tfs 1.2

jackl90

Member
Joined
Jul 25, 2017
Messages
249
Reaction score
12
Hello friends, how can I solve the problem that I'm not able to use the rope when I'm on top of the sewer grate? error is showing (You cannot use this object)

how can i enable being able to use the rope when i'm on top of sewer grate?


thanks in advance
Lua:
local ropeSpots = {
    386, 421
}
 
local holeSpots = {
    293, 294, 369, 370, 385, 394, 411, 412,
    421, 432, 433, 435, 482, 5081, 483, 594,
    595, 607, 609, 610, 615, 1066, 1067, 1080
}
 
function onUse(player, item, fromPosition, target, toPosition)
    local tile = Tile(toPosition)
    if not tile then
        return false
    end
  
    if not target:isItem() then
        return false
    end
  
    if target:getId() >= 2886 and target:getId() <= 2891 or target:getId() == 2895 then
        target = tile:getGround()
    end
  
    if table.contains(ropeSpots, target:getId()) then
        player:teleportTo(target:getPosition():moveRel(0, 1, -1))
        return true
    elseif table.contains(holeSpots, target:getId()) or target:getId() == 435 then
        local tile = Tile(target:getPosition():moveRel(0, 0, 1))
        if not tile then
            return false
        end
      
        local thing = tile:getTopCreature()
        if not thing then
            thing = tile:getTopVisibleThing()
        end
      
        if thing:isCreature() then
            thing:teleportTo(target:getPosition():moveRel(0, 1, 0), false)
            return true
        end
        if thing:isItem() and thing:getType():isMovable() then
            thing:moveTo(target:getPosition():moveRel(0, 1, 0))
            return true
        end
        return true
    end
    return false
end
 

Disastrous

New Member
Joined
Oct 18, 2022
Messages
12
Reaction score
0
That is possible in the newer versions right? Just download a newer datapack and take the rope script from that and copy to yours
 

mano368

Intermediate OT User
Joined
Sep 2, 2011
Messages
352
Solutions
35
Reaction score
142
Location
Brazil
@jackl90

Try add sewer id here in line 21
Lua:
    if target:getId() >= 2886 and target:getId() <= 2891 or target:getId() == 2895 or target:getId() == SEWERID then
        target = tile:getGround()
    end

Also, make sure that sewer id is here also:
Line 5, local holeSpots
 
Top