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

C++ Ladder TFS 1.3 OTX

keilost

Member
Joined
Aug 4, 2012
Messages
63
Reaction score
12
Location
Brazil
Hello,

When someone put an item up the stairs, nobody can use it.

Follow the gif:

Animated GIF - Find & Share on GIPHY



My teleport action:


Lua:
local upFloorIds = {1386, 3678, 5543, 8599, 10035}
local draw_well = 1369

function onUse(player, item, fromPosition, target, toPosition, isHotkey)
    if item.itemid == draw_well and item.actionid ~= 100 then
        return false
    end

    if table.find(upFloorIds, item.itemid) then
        fromPosition:moveUpstairs()
    else
        fromPosition.z = fromPosition.z + 1
    end

    if player:isPzLocked() and Tile(fromPosition):hasFlag(TILESTATE_PROTECTIONZONE) then
        player:sendCancelMessage(RETURNVALUE_PLAYERISPZLOCKED)
        return true
    end

    player:teleportTo(fromPosition, false)
    return true
end
 
work fine here
Hello,

When someone put an item up the stairs, nobody can use it.

Follow the gif:

Animated GIF - Find & Share on GIPHY



My teleport action:


Lua:
local upFloorIds = {1386, 3678, 5543, 8599, 10035}
local draw_well = 1369

function onUse(player, item, fromPosition, target, toPosition, isHotkey)
    if item.itemid == draw_well and item.actionid ~= 100 then
        return false
    end

    if table.find(upFloorIds, item.itemid) then
        fromPosition:moveUpstairs()
    else
        fromPosition.z = fromPosition.z + 1
    end

    if player:isPzLocked() and Tile(fromPosition):hasFlag(TILESTATE_PROTECTIONZONE) then
        player:sendCancelMessage(RETURNVALUE_PLAYERISPZLOCKED)
        return true
    end

    player:teleportTo(fromPosition, false)
    return true
end

my script
Lua:
local upFloorIds = {1386, 3678, 5543, 8599, 10035, 13010, 22845, 22846}
local draw_well = 1369

function onUse(player, item, fromPosition, target, toPosition, isHotkey)
    if item.itemid == draw_well and item.actionid ~= 100 then
        return false
    end

    if table.contains(upFloorIds, item.itemid) then
        fromPosition:moveUpstairs()
    else
        fromPosition.z = fromPosition.z + 1
    end

    if player:isPzLocked() and Tile(fromPosition):hasFlag(TILESTATE_PROTECTIONZONE) then
        player:sendCancelMessage(RETURNVALUE_PLAYERISPZLOCKED)
        return true
    end

    player:teleportTo(fromPosition, false)
    return true
end
 
Back
Top