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

RevScripts HELP PICK FENROCK

Igor Milagres

Member
Joined
May 12, 2018
Messages
76
Reaction score
21
Hello friends, I wanted to know how to put the PICK to open this entrance to Fenrock, I know that in GLOBAL, you need to talk to the NPC before you can use the PICK, but in my OT there is no such quest, just the map, I would like to put it back so that when you use the pick you go to the bottom floor, can anyone tell me how to do this? SERVER TFS 1.2 NOSTALRIUS 8.0

WhatsApp Image 2024-04-04 at 6.37.39 PM.jpeg
 
just go to your pick script, put the crack as target item and add player:teleportTo(NEW LOCATION)
Could you tell me which part I fit this into? Sorry for my ignorance and thanks for helping!

Lua:
local pitsOfInfernoLava = {
    Position(32808, 32336, 11),
    Position(32809, 32336, 11),
    Position(32810, 32336, 11),
    Position(32808, 32334, 11),
    Position(32807, 32334, 11),
    Position(32807, 32335, 11),
    Position(32807, 32336, 11),
    Position(32807, 32337, 11),
    Position(32806, 32337, 11),
    Position(32805, 32337, 11),
    Position(32805, 32338, 11),
    Position(32805, 32339, 11),
    Position(32806, 32339, 11),
    Position(32806, 32338, 11),
    Position(32807, 32338, 11),
    Position(32808, 32338, 11),
    Position(32808, 32337, 11),
    Position(32809, 32337, 11),
    Position(32810, 32337, 11),
    Position(32811, 32337, 11),
    Position(32811, 32338, 11),
    Position(32806, 32338, 11),
    Position(32810, 32338, 11),
    Position(32810, 32339, 11),
    Position(32809, 32339, 11),
    Position(32809, 32338, 11),
    Position(32811, 32336, 11),
    Position(32811, 32335, 11),
    Position(32810, 32335, 11),
    Position(32809, 32335, 11),
    Position(32808, 32335, 11),
    Position(32809, 32334, 11),
    Position(32809, 32333, 11),
    Position(32810, 32333, 11),
    Position(32811, 32333, 11),
    Position(32806, 32338, 11),
    Position(32810, 32334, 11),
    Position(32811, 32334, 11),
    Position(32812, 32334, 11),
    Position(32813, 32334, 11),
    Position(32812, 32333, 11),
    Position(32810, 32334, 11),
    Position(32812, 32335, 11),
    Position(32813, 32335, 11),
    Position(32813, 32333, 11)
}
        
function onUse(player, item, fromPosition, target, toPosition)
    local tile = Tile(toPosition)
    if not tile then
        return false
    end

    local ground = tile:getGround()
    if not ground then
        return false
    end
    
    if ground:getId() == 372 then
        ground:transform(394, 1)
        ground:decay()
        return true
    elseif target:getId() == 1772 and toPosition.x == 32648 and toPosition.y == 32134 and toPosition.z == 10 and math.random(1, 100) <= 40 then
        Game.sendMagicEffect({x = 32648, y = 32134, z = 10}, 3)
        Game.removeItemOnMap({x = 32648, y = 32134, z = 10}, 1772)
        return true
    elseif target:getId() == 1772 and toPosition.x == 32648 and toPosition.y == 32134 and toPosition.z == 10 then
        Game.sendMagicEffect({x = 32648, y = 32134, z = 10}, 3)
        doTargetCombatHealth(0, player, COMBAT_PHYSICALDAMAGE, -40, -40)
        return true
    elseif target:getId() == 1791 and toPosition.x == 32356 and toPosition.y == 32074 and toPosition.z == 10 and math.random(1, 100) <= 40 then
        Game.sendMagicEffect({x = 32356, y = 32074, z = 10}, 3)
        Game.removeItemOnMap({x = 32356, y = 32074, z = 10}, 1791)
        return true
    elseif target:getId() == 1791 and toPosition.x == 32356 and toPosition.y == 32074 and toPosition.z == 10 then
        Game.sendMagicEffect({x = 32356, y = 32074, z = 10}, 3)
        doTargetCombatHealth(0, player, COMBAT_PHYSICALDAMAGE, -50, -50)
        return true
    elseif target:getActionId() == 17643 then
        for i = 1, #pitsOfInfernoLava do
            Game.createItem(5815, 1, pitsOfInfernoLava[i])
        end
        target:transform(3141)
        toPosition:sendMagicEffect(CONST_ME_POFF)
        return true
    end
    return false
end
 
after line 63

add:
Lua:
elseif target:getId() == CRACKID then
     player:teleportTo(POSITION TO TELEPORT)
     return true
 
Solution
after line 63

add:
Lua:
elseif target:getId() == CRACKID then
     player:teleportTo(POSITION TO TELEPORT)
     return true
It didn't work and I got the following error:

Lua Script Error: [Action Interface]
data/actions/scripts/misc/pick.lua:eek:nUse
attemp to index a number value
stack traceback:
[C]: at 0x7ff6afc3d760
[C]: in function 'teleportTo'
data/actions/scripts/misc/pick.lua:65: in function <data/actions/scripts/misc/pick.lua:49>


Lua:
local pitsOfInfernoLava = {
    Position(32808, 32336, 11),
    Position(32809, 32336, 11),
    Position(32810, 32336, 11),
    Position(32808, 32334, 11),
    Position(32807, 32334, 11),
    Position(32807, 32335, 11),
    Position(32807, 32336, 11),
    Position(32807, 32337, 11),
    Position(32806, 32337, 11),
    Position(32805, 32337, 11),
    Position(32805, 32338, 11),
    Position(32805, 32339, 11),
    Position(32806, 32339, 11),
    Position(32806, 32338, 11),
    Position(32807, 32338, 11),
    Position(32808, 32338, 11),
    Position(32808, 32337, 11),
    Position(32809, 32337, 11),
    Position(32810, 32337, 11),
    Position(32811, 32337, 11),
    Position(32811, 32338, 11),
    Position(32806, 32338, 11),
    Position(32810, 32338, 11),
    Position(32810, 32339, 11),
    Position(32809, 32339, 11),
    Position(32809, 32338, 11),
    Position(32811, 32336, 11),
    Position(32811, 32335, 11),
    Position(32810, 32335, 11),
    Position(32809, 32335, 11),
    Position(32808, 32335, 11),
    Position(32809, 32334, 11),
    Position(32809, 32333, 11),
    Position(32810, 32333, 11),
    Position(32811, 32333, 11),
    Position(32806, 32338, 11),
    Position(32810, 32334, 11),
    Position(32811, 32334, 11),
    Position(32812, 32334, 11),
    Position(32813, 32334, 11),
    Position(32812, 32333, 11),
    Position(32810, 32334, 11),
    Position(32812, 32335, 11),
    Position(32813, 32335, 11),
    Position(32813, 32333, 11)
}
        
function onUse(player, item, fromPosition, target, toPosition)
    local tile = Tile(toPosition)
    if not tile then
        return false
    end

    local ground = tile:getGround()
    if not ground then
        return false
    end
    
    if ground:getId() == 372 then
        ground:transform(394, 1)
        ground:decay()
        return true
    elseif target:getId() == 6298 then
        player:teleportTo(31110, 31360, 10)
        return true
    elseif target:getId() == 1772 and toPosition.x == 32648 and toPosition.y == 32134 and toPosition.z == 10 and math.random(1, 100) <= 40 then
        Game.sendMagicEffect({x = 32648, y = 32134, z = 10}, 3)
        Game.removeItemOnMap({x = 32648, y = 32134, z = 10}, 1772)
        return true
    elseif target:getId() == 1772 and toPosition.x == 32648 and toPosition.y == 32134 and toPosition.z == 10 then
        Game.sendMagicEffect({x = 32648, y = 32134, z = 10}, 3)
        doTargetCombatHealth(0, player, COMBAT_PHYSICALDAMAGE, -40, -40)
        return true
    elseif target:getId() == 1791 and toPosition.x == 32356 and toPosition.y == 32074 and toPosition.z == 10 and math.random(1, 100) <= 40 then
        Game.sendMagicEffect({x = 32356, y = 32074, z = 10}, 3)
        Game.removeItemOnMap({x = 32356, y = 32074, z = 10}, 1791)
        return true
    elseif target:getId() == 1791 and toPosition.x == 32356 and toPosition.y == 32074 and toPosition.z == 10 then
        Game.sendMagicEffect({x = 32356, y = 32074, z = 10}, 3)
        doTargetCombatHealth(0, player, COMBAT_PHYSICALDAMAGE, -50, -50)
        return true
    elseif target:getActionId() == 17643 then
        for i = 1, #pitsOfInfernoLava do
            Game.createItem(5815, 1, pitsOfInfernoLava[i])
        end
        target:transform(3141)
        toPosition:sendMagicEffect(CONST_ME_POFF)
        return true
    end
    return false
end
 
It didn't work and I got the following error:

Lua Script Error: [Action Interface]
data/actions/scripts/misc/pick.lua:eek:nUse
attemp to index a number value
stack traceback:
[C]: at 0x7ff6afc3d760
[C]: in function 'teleportTo'
data/actions/scripts/misc/pick.lua:65: in function <data/actions/scripts/misc/pick.lua:49>


Lua:
local pitsOfInfernoLava = {
    Position(32808, 32336, 11),
    Position(32809, 32336, 11),
    Position(32810, 32336, 11),
    Position(32808, 32334, 11),
    Position(32807, 32334, 11),
    Position(32807, 32335, 11),
    Position(32807, 32336, 11),
    Position(32807, 32337, 11),
    Position(32806, 32337, 11),
    Position(32805, 32337, 11),
    Position(32805, 32338, 11),
    Position(32805, 32339, 11),
    Position(32806, 32339, 11),
    Position(32806, 32338, 11),
    Position(32807, 32338, 11),
    Position(32808, 32338, 11),
    Position(32808, 32337, 11),
    Position(32809, 32337, 11),
    Position(32810, 32337, 11),
    Position(32811, 32337, 11),
    Position(32811, 32338, 11),
    Position(32806, 32338, 11),
    Position(32810, 32338, 11),
    Position(32810, 32339, 11),
    Position(32809, 32339, 11),
    Position(32809, 32338, 11),
    Position(32811, 32336, 11),
    Position(32811, 32335, 11),
    Position(32810, 32335, 11),
    Position(32809, 32335, 11),
    Position(32808, 32335, 11),
    Position(32809, 32334, 11),
    Position(32809, 32333, 11),
    Position(32810, 32333, 11),
    Position(32811, 32333, 11),
    Position(32806, 32338, 11),
    Position(32810, 32334, 11),
    Position(32811, 32334, 11),
    Position(32812, 32334, 11),
    Position(32813, 32334, 11),
    Position(32812, 32333, 11),
    Position(32810, 32334, 11),
    Position(32812, 32335, 11),
    Position(32813, 32335, 11),
    Position(32813, 32333, 11)
}
        
function onUse(player, item, fromPosition, target, toPosition)
    local tile = Tile(toPosition)
    if not tile then
        return false
    end

    local ground = tile:getGround()
    if not ground then
        return false
    end
    
    if ground:getId() == 372 then
        ground:transform(394, 1)
        ground:decay()
        return true
    elseif target:getId() == 6298 then
        player:teleportTo(31110, 31360, 10)
        return true
    elseif target:getId() == 1772 and toPosition.x == 32648 and toPosition.y == 32134 and toPosition.z == 10 and math.random(1, 100) <= 40 then
        Game.sendMagicEffect({x = 32648, y = 32134, z = 10}, 3)
        Game.removeItemOnMap({x = 32648, y = 32134, z = 10}, 1772)
        return true
    elseif target:getId() == 1772 and toPosition.x == 32648 and toPosition.y == 32134 and toPosition.z == 10 then
        Game.sendMagicEffect({x = 32648, y = 32134, z = 10}, 3)
        doTargetCombatHealth(0, player, COMBAT_PHYSICALDAMAGE, -40, -40)
        return true
    elseif target:getId() == 1791 and toPosition.x == 32356 and toPosition.y == 32074 and toPosition.z == 10 and math.random(1, 100) <= 40 then
        Game.sendMagicEffect({x = 32356, y = 32074, z = 10}, 3)
        Game.removeItemOnMap({x = 32356, y = 32074, z = 10}, 1791)
        return true
    elseif target:getId() == 1791 and toPosition.x == 32356 and toPosition.y == 32074 and toPosition.z == 10 then
        Game.sendMagicEffect({x = 32356, y = 32074, z = 10}, 3)
        doTargetCombatHealth(0, player, COMBAT_PHYSICALDAMAGE, -50, -50)
        return true
    elseif target:getActionId() == 17643 then
        for i = 1, #pitsOfInfernoLava do
            Game.createItem(5815, 1, pitsOfInfernoLava[i])
        end
        target:transform(3141)
        toPosition:sendMagicEffect(CONST_ME_POFF)
        return true
    end
    return false
end
the problem is in the position, the way you wrote is not accepted, you must use similar to the others you already have in your script:
Lua:
player:teleportTo({x=31110,y=31360,z=10})
or:
Lua:
player:teleportTo(Position(31110, 31360, 10))
 
the problem is in the position, the way you wrote is not accepted, you must use similar to the others you already have in your script:
Lua:
player:teleportTo({x=31110,y=31360,z=10})
or:
Lua:
player:teleportTo(Position(31110, 31360, 10))
IT WORKED, thank you very much friend!
 
Back
Top