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

Lua Looking for teleport script tfs 1.3

God Mythera

Veteran OT User
Joined
Aug 11, 2012
Messages
2,048
Solutions
2
Reaction score
256
Location
United States
Hello and I am looking for a teleport script to use an item and you can use it even when pz'd you just can't use it when you have white skull Red skull or black skull.


Is this possible? xD
 
Lua:
local skulls = {SKULL_BLACK, SKULL_RED, SKULL_GREEN, SKULL_ORANGE, SKULL_YELLOW, SKULL_WHITE}
local position = Position(1000, 1000, 7)
local effect = CONST_ME_POFF
local itemId = 2299
local exhaustTable = {}
local cooldown = 60

local action = Action()

function action.onUse(player, item, fromPos, target, toPos, isHotkey)
    if not player then
        return true
    end
    local playerGuid = player:getGuid()
    local timeAmount = exhaustTable[playerGuid]
    if timeAmount and timeAmount > os.time() then
        player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "You must wait " .. (timeAmount - os.time()) .. " seconds.")
        return true
    end
    if table.contains(skulls, player:getSkull()) then
        player:sendTextMessage(MESSAGE_EVENT_ADVANCE, 'You can not use this item aslong you got a skull.')
        return true
    end
    player:teleportTo(position)
    player:getPosition():sendMagicEffect(effect)
    player:sendTextMessage(MESSAGE_EVENT_ADVANCE, 'You have been teleported.')
    exhaustTable[playerGuid] = os.time() + cooldown
    return true
end

action:id(itemId)
action:register()

Something like this?
 
Back
Top