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

Solved Globalevent tp boss

Acrenactive

★Designer★
Joined
Mar 21, 2013
Messages
224
Reaction score
55
Location
Los Angels L.A
Hello guys!
------------------------
TFS - 0.4 3777 Client 8.6
------------------------
I have a problem with a script, Would appreciate if anyone could help me. I want a boss tp should spawn when the countdown has counted one minute.

But my script works with countdown. But teleport dont created some times and when it has created is teleport you nowhere.
btw Sorry for my english :D

here is the script

local createpos = {x=705,y=1246,z=5}
local topos = {x=748,y=1296,z=7}
local msg = "Eleminator Boss TP has now closed! It will open again in 1 Hours!"
local timetoclose = 60 -- in second

local function remove()
local tp = getTileItemById(createpos,1387).uid
if tp ~= 0 then
doRemoveItem(tp)
doBroadcastMessage(msg)
end
end

function onThink(interval)
local tp = doCreateItem(1387, 1, createpos)
doItemSetAttribute(tp, "aid", 37720)
doBroadcastMessage("Eleminator Boss TP is now open!\nCatch the teleport within "..timetoclose.." seconds quickly! Located in Underground Depo.")
addEvent(remove,timetoclose*1000)
return true
end
vaSAaQs.png
 
Last edited:
Hello guys!
------------------------
TFS - 0.4 3777
------------------------
I have a problem with a script, Would appreciate if anyone could help me. I want a boss tp should spawn when the countdown has counted one minute.

But my script works with countdown. But teleport dont created some times and when it has created is teleport you nowhere.
btw Sorry for my english :D

here is the script

hint:
doCreateTeleport(itemid, topos, createpos)
 
someone please help me ?

Code:
local createpos = {x = 705,y = 1246, z = 5}
local topos = {x = 748, y = 1296, z = 7}
local msg = "Eleminator Boss TP has now closed! It will open again in 1 Hours!"
local timetoclose = 60
local teleportID = 1387

function createTeleport()
    doCreateTeleport(teleportID, topos, createpos)
    doItemSetAttribute(getTileItemById(createpos, teleportID).uid, 'aid', 37720)
end

function removeTeleport()
    local teleport = getTileItemById(createpos, teleportID)
    if (teleport.uid > 0) then
        doRemoveItem(teleport.uid, 1)
        doSendMagicEffect(createpos, CONST_ME_POFF)
    end
end

function onThink(interval)
    createTeleport()
    doBroadcastMessage("Eleminator Boss TP is now open!\nCatch the teleport within "..timetoclose.." seconds quickly! Located in Underground Depot.")
    addEvent(function() removeTeleport() doBroadcastMessage(msg) end, timetoclose * 1000)
    return true
end
 
Code:
local createpos = {x = 705,y = 1246, z = 5}
local topos = {x = 748, y = 1296, z = 7}
local msg = "Eleminator Boss TP has now closed! It will open again in 1 Hours!"
local timetoclose = 60
local teleportID = 1387

function createTeleport()
    doCreateTeleport(teleportID, topos, createpos)
    doItemSetAttribute(getTileItemById(createpos, teleportID).uid, 'aid', 37720)
end

function removeTeleport()
    local teleport = getTileItemById(createpos, teleportID)
    if (teleport.uid > 0) then
        doRemoveItem(teleport.uid, 1)
        doSendMagicEffect(createpos, CONST_ME_POFF)
    end
end

function onThink(interval)
    createTeleport()
    doBroadcastMessage("Eleminator Boss TP is now open!\nCatch the teleport within "..timetoclose.." seconds quickly! Located in Underground Depot.")
    addEvent(function() removeTeleport() doBroadcastMessage(msg) end, timetoclose * 1000)
    return true
end
Hey @Musztang !

I have tested your script but it does not work either.I might do something wrong as examples in map editor should be actionid 37720 or should that be in the uniqueid

in globalevents.xml :
<globalevent name="Race1" interval="3600000" event="script" value="bossestp.lua"/>
 
If you're still using action id, then set a movement script that teleports the player to the given position when he steps on item with that action id.

or you can still use the function doCreateTeleport(itemid, topos, createpos)
It is self explanatory, where itemId is the teleporter item ID. toPos is where you'll be sent when step on that teleport. creatPos is the position where teleport will be created.

This board is supposed to give support for newbies, @Xeraphus. Be more patient.
 
If you're still using action id, then set a movement script that teleports the player to the given position when he steps on item with that action id.

or you can still use the function doCreateTeleport(itemid, topos, createpos)
It is self explanatory, where itemId is the teleporter item ID. toPos is where you'll be sent when step on that teleport. creatPos is the position where teleport will be created.

This board is supposed to give support for newbies, @Xeraphus. Be more patient.
?
 
There are 2 ways to do this.
  1. Set a movement script to allow people to enter the portal when a global storage value = 1.
  2. Create a teleport and delete a teleport.
If you use the Global Storage Value way, it has much less chances to mess up. But you don't get the Teleport appearing/disappearing.

There is also a 3rd way that includes the best of both worlds. (I guess)

Have your script check to see if a teleport is there.
If the teleport is NOT there and should be (per global storage), Create it.
If the teleport IS there and should NOT be (per global storage), then remove it.

Any of these 3 options work.
 
you're smart enough to figure this out on your own with that hint :^)

There are 2 ways to do this.
  1. Set a movement script to allow people to enter the portal when a global storage value = 1.
  2. Create a teleport and delete a teleport.
If you use the Global Storage Value way, it has much less chances to mess up. But you don't get the Teleport appearing/disappearing.

There is also a 3rd way that includes the best of both worlds. (I guess)

Have your script check to see if a teleport is there.
If the teleport is NOT there and should be (per global storage), Create it.
If the teleport IS there and should NOT be (per global storage), then remove it.

Any of these 3 options work.
I think he's setting up a unique world.
 
Back
Top