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

[TFS 1.2 TELEPORT ITEM]

Zak.Tibiam

New Member
Joined
Mar 25, 2012
Messages
150
Reaction score
3
Hello guys, who can help me with use 'X' item to be teleport to other place, for example:

Use item 9999 will be teletransport to venore only if not PZ

Thanks!
 
Code:
function onUse(player, item, fromPosition, target, toPosition, isHotkey)
    local playerPos = player:getPosition()
    local destination = Position(32, 32, 6)

    if not Tile(playerPos):hasFlag(TILESTATE_PROTECTIONZONE) then
        player:sendTextMessage(MESSAGE_EVENT_ADVANCE, 'You are not in PZ.')
        return false
    end

    player:teleportTo(destination)
    destination:sendMagicEffect(CONST_ME_TELEPORT)
  
    return true
end

I think i didnt understand what he meant XD
 
Last edited:
Code:
local pos = Position(1, 1, 1)
function onUse(player, item, fromPosition, target, toPosition, isHotkey)
    if not player:isPzLocked() then
        player:teleportTo(pos)
        pos:sendMagicEffect(CONST_ME_TELEPORT)
    else
        player:sendTextMessage(MESSAGE_STATUS_SMALL, 'You may not use this in PZ.')
        fromPosition:sendMagicEffect(CONST_ME_POFF)
    end
    return true
end
 
Back
Top