• 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!
  • 2026 staff recruitment is open! Check it out and consider applying!

Every time a kill a monster this happens

wafuboe

Active Member
Joined
Dec 24, 2010
Messages
884
Solutions
2
Reaction score
26
Every time i kill a monster a message shows "You have 60 seconds to enter the teleport"
I think it has something to do with this script

Code:
local config = {
    ["hellgorak"] = {time = 60, toPos = Position(1070, 1313, 6), tpPos = Position(1192, 1219, 5)}
}
local function deleteTeleport(position)
    local teleport = Tile(position):getItemById(1387)
    if teleport then
        teleport:remove()
        position:sendMagicEffect(CONST_ME_POFF)
    end
end
function onKill(creature, target)
    local monster = config[target:getName():lower()]
    if not monster or target:isPlayer() then
        return true
    end
    local item = Game.createItem(1387, 1, monster.tpPos)
    if item:isTeleport() then
        item:setDestination(monster.toPos)
    end
    creature:say("You have " .. monster.time .. " seconds to enter the teleport!", TALKTYPE_MONSTER_SAY)
    addEvent(deleteTeleport, monster.time * 1000, monster.tpPos)
    return true
end

Creaturescripts.xml
<event type="kill" name="CreateTeleport6" script="hellgoraktp.lua"/>

Login.
player:registerEvent("CreateTeleport5")

Any ideas?
 
Rly i don't know what u want?
Monster died so script send msg and create tp for 60 sec. Works "like" in rl tibia.
If u use that monster not like inq boss just remove all.

@edit:
You mean: when u kill any monster this msg shows? You need to be more specific.
 
Last edited:
mm
you have 2 events unless you messed up in the first post
you posted CreateTeleport6 but said its CreateTeleport5 in login.lua ?
 
Delete one by one this all teleport scripts and check after which problem will not appear, cuz this script with: hellgorak works for me fine.
 
Its this one

Code:
local bossStorage = 555
local teleportPos = Position(1152, 1259, 5) -- position where tp will be created
local teleportDestination = Position(1157, 1200, 6) -- teleport destination
local teleportRemoveTime = 1 * 60 * 1000 -- remove teleport: TIME 1=1min
local function removeTeleport()
    local teleportItem = Tile(teleportPos):getItemById(1387)
    if teleportItem then
        teleportItem:remove()
        teleportPos:sendMagicEffect(CONST_ME_POFF)
    end
end
function onKill(player, target)
    local targetMonster = target:getMonster()
    if not targetMonster then
        return true
    end
    local targetName = targetMonster:getName():lower()
    local newValue = 2
    if targetName == 'golgordan' or targetName == 'latrivan' then -- add here yours bosses names!
        newValue = math.max(0, Game.getStorageValue(bossStorage)) + 1
    end
    Game.setStorageValue(bossStorage, newValue)
    if newValue == 2 then
        player:say('You have 60 seconds to enter the teleport', TALKTYPE_MONSTER_SAY) -- Msg, u can use another msg function /broadcast etc
        addEvent(Game.setStorageValue, teleportRemoveTime, bossStorage, 0)
        teleportPos:sendMagicEffect(CONST_ME_TELEPORT)
        Game.createItem(1387, 1, teleportPos)
    end
    local teleport = Tile(teleportPos):getItemById(1387)
    if teleport then
        teleport:setDestination(teleportDestination)
        addEvent(removeTeleport, teleportRemoveTime, teleportPos)
    end
    return true
end
Delete one by one this all teleport scripts and check after which problem will not appear, cuz this script with: hellgorak works for me fine.
 
LUA:
local bossStorage = 555
local teleportPos = Position(1152, 1259, 5) -- position where tp will be created
local teleportDestination = Position(1157, 1200, 6) -- teleport destination
local teleportRemoveTime = 1 * 60 * 1000 -- remove teleport: TIME 1=1min
local function removeTeleport()
    local teleportItem = Tile(teleportPos):getItemById(1387)
    if teleportItem then
        teleportItem:remove()
        teleportPos:sendMagicEffect(CONST_ME_POFF)
    end
end
function onKill(player, target)
    local targetMonster = target:getMonster()
    if not targetMonster then
        return true
    end
    local targetName = targetMonster:getName():lower()
    local newValue = -1
    if targetName == 'golgordan' or targetName == 'latrivan' then -- add here yours bosses names!
        newValue = math.max(0, Game.getStorageValue(bossStorage)) + 1
    end
    Game.setStorageValue(bossStorage, newValue)
    if newValue ~= -1 then
        player:say('You have 60 seconds to enter the teleport', TALKTYPE_MONSTER_SAY) -- Msg, u can use another msg function /broadcast etc
        addEvent(Game.setStorageValue, teleportRemoveTime, bossStorage, 0)
        teleportPos:sendMagicEffect(CONST_ME_TELEPORT)
        Game.createItem(1387, 1, teleportPos)
    end
    local teleport = Tile(teleportPos):getItemById(1387)
    if teleport then
        teleport:setDestination(teleportDestination)
        addEvent(removeTeleport, teleportRemoveTime, teleportPos)
    end
    return true
end
 
@Xeraphus solves the problem, but then when you kill just 1boss, teleport will be appear, try this:

LUA:
local bosses = {
    ['golgordan'] = 555,
    ['latrivan'] = 555
}

local teleportPos = Position(1152, 1259, 5) -- position where tp will be created /to edit
local teleportDestination = Position(1157, 1200, 6) -- teleport destination /to edit
local teleportRemoveTime = 1 * 60 * 1000 -- remove teleport: TIME 1=1min /to edit

local timeMsg = teleportRemoveTime /1000

local function removeTeleport()
    local teleportItem = Tile(teleportPos):getItemById(1387)
    if teleportItem then
        teleportItem:remove()
        teleportPos:sendMagicEffect(CONST_ME_POFF)
    end
end
function onKill(player, target)
    local targetMonster = target:getMonster()
    if not targetMonster then
        return true
    end
    local targetName = targetMonster:getName():lower()
    local bossStorage = bosses[targetName]
    if not bossStorage then
        return true
    end
    local newValue = 2
    if targetName == 'golgordan' or targetName == 'latrivan' then -- add here yours bosses names! /to edit
        newValue = math.max(0, Game.getStorageValue(bossStorage)) + 1
    end
    Game.setStorageValue(bossStorage, newValue)
    if newValue == 2 then
        player:say('You have '..timeMsg..' seconds to enter the teleport!', TALKTYPE_MONSTER_SAY) -- Msg, u can use another msg function /broadcast etc
        addEvent(Game.setStorageValue, teleportRemoveTime, bossStorage, 0)
        teleportPos:sendMagicEffect(CONST_ME_TELEPORT)
        Game.createItem(1387, 1, teleportPos)
    end
    local teleport = Tile(teleportPos):getItemById(1387)
    if teleport then
        teleport:setDestination(teleportDestination)
        addEvent(removeTeleport, teleportRemoveTime, teleportPos)
    end
    return true
end
 
Last edited:
@Xeraphus solves the problem, but then when you kill just 1boss, teleport will be appear, try this:

LUA:
local bosses = {
    ['golgordan'] = 555,
    ['latrivan'] = 555
}

local teleportPos = Position(1152, 1259, 5) -- position where tp will be created /to edit
local teleportDestination = Position(1157, 1200, 6) -- teleport destination /to edit
local teleportRemoveTime = 1 * 60 * 1000 -- remove teleport: TIME 1=1min /to edit

local timeMsg = teleportRemoveTime /1000

local function removeTeleport()
    local teleportItem = Tile(teleportPos):getItemById(1387)
    if teleportItem then
        teleportItem:remove()
        teleportPos:sendMagicEffect(CONST_ME_POFF)
    end
end
function onKill(player, target)
    local targetMonster = target:getMonster()
    if not targetMonster then
        return true
    end
    local targetName = targetMonster:getName():lower()
    local bossStorage = bosses[targetName]
    if not bossStorage then
        return true
    end
    local newValue = 2
    if targetName == 'golgordan' or targetName == 'latrivan' then -- add here yours bosses names! /to edit
        newValue = math.max(0, Game.getStorageValue(bossStorage)) + 1
    end
    Game.setStorageValue(bossStorage, newValue)
    if newValue == 2 then
        player:say('You have '..timeMsg..' seconds to enter the teleport!', TALKTYPE_MONSTER_SAY) -- Msg, u can use another msg function /broadcast etc
        addEvent(Game.setStorageValue, teleportRemoveTime, bossStorage, 0)
        teleportPos:sendMagicEffect(CONST_ME_TELEPORT)
        Game.createItem(1387, 1, teleportPos)
    end
    local teleport = Tile(teleportPos):getItemById(1387)
    if teleport then
        teleport:setDestination(teleportDestination)
        addEvent(removeTeleport, teleportRemoveTime, teleportPos)
    end
    return true
end

teleport doesnt show,
This error on console btw
Tfs 1.2
359h9w5.png
 
Back
Top