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
now open and created your event.lua
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)
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"/>
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: