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

GlobalEvent Teleport open specific days and hours

Cronox

www.Searz-Online.com
Joined
Jul 5, 2011
Messages
1,810
Reaction score
123
Location
Mexico
I make 1 easy script simple configuration ;)
tested in 0.4 and 0.3.6 works 100%
This script created 1 teleport.. day Saturday , Hour: 17 hours ( time pc )
open
data/globalevents and open globalevents.xml and add
Lua:
<globalevent name="event" time="17:00" event="script" value="event.lua"/>
now open and created your event.lua
Lua:
local cfg = {
	teleportPos = {x = 1, y = 2, z = 6, stackpos = 1}, -- where appear teleport
	teleportToPos = {x = 1, y = 2, z = 7}, -- position where send teleport.
	min = 10  -- time minutes open.. 10 min and closee tp
}
 
function onTime()
	if(os.date("%A") == "Saturday") then -- you can edit Saturday for: Monday , Tuesday ,etc
		doCreateTeleport(1387, cfg.teleportToPos, cfg.teleportPos)
		doBroadcastMessage("Event has started!\nTeleport created in ... \nEvent will start in 10 Minutes!", MESSAGE_EVENT_ADVANCE)
		addEvent(doRemoveItem, cfg.min * 60 * 1000, getThingfromPos({x = 1, y = 2, z = 6, stackpos = 1}).uid, 1)
	end
	return true
end

and ready you have 1 teleport open specific day and hour ;)

---------
Thanks for release Zbizu
All functions from this code are in 0.2 so should work on it also.
(may require: doBroadcastMessage = broadcastMessage in global.lua)

here are more ^^
day in the month:
os.date("%e") == 20
day of the year(3rd Feb):
os.date("%j") == 34
only this month(everyday in November as example):
os.date("%m") == 11
10th-25th of November ^^
if(os.date("%e") >= 10 and os.date("%e") <= 25 and os.date("%m") == 11) then
(based on: strftime - C++ Reference)
 
Last edited:
repped u for epic idea ;)
All functions from this code are in 0.2 so should work on it also.

(may require: doBroadcastMessage = broadcastMessage in global.lua)

here are more ^^
day in the month:
os.date("%e") == 20

day of the year(3rd Feb):
os.date("%j") == 34

only this month(everyday in November as example):
os.date("%m") == 11

10th-25th of November ^^
if(os.date("%e") >= 10 and os.date("%e") <= 25 and os.date("%m") == 11) then
(based on: strftime - C++ Reference)
 
but teleport wont `close`.

Now it will.

Code:
-- made by cronox
 
local cfg = {
	teleportPos = {x = 1, y = 2, z = 6, stackpos = 1},
	teleportToPos = {x = 1, y = 2, z = 7},
	min = 10 -- time minutes open.. 10 min and closee tp
}
 
function onTime()
	if(os.date("%A") == "Saturday") then -- you can edit Saturday for: Monday , Tuesday ,etc
		doCreateTeleport(1387, cfg.teleportToPos, cfg.teleportPos)
		doBroadcastMessage("Teleport are Open for Event...", MESSAGE_EVENT_ADVANCE)
                addEvent(doRemoveItem,cfg.min*60*1000,getThingfromPos(cfg.teleportPos).uid)
	end
	return true
end
 
Erexo here u you go
post updated now are closed automatic in 10 minutes or move configuration in local and added functions release zbizu ;)
Lua:
local cfg = {
	teleportPos = {x = 1, y = 2, z = 6, stackpos = 1}, -- where appear teleport
	teleportToPos = {x = 1, y = 2, z = 7}, -- position where send teleport.
	min = 10  -- time minutes open.. 10 min and closee tp
}

function onTime()
	if(os.date("%A") == "Saturday") then -- you can edit Saturday for: Monday , Tuesday ,etc
		doCreateTeleport(1387, cfg.teleportToPos, cfg.teleportPos)
		doBroadcastMessage("Event has started!\nTeleport created in ... \nEvent will start in 10 Minutes!", MESSAGE_EVENT_ADVANCE)
		addEvent(doRemoveItem, cfg.min * 60 * 1000, getThingfromPos({x = 1, y = 2, z = 6, stackpos = 1}).uid, 1)
	end
	return true
end
 
DaPlaya ,try changed
Lua:
function onTime()
for
Lua:
function onTimer()
 
Back
Top