dervin13
Active Member
- Joined
- Apr 26, 2008
- Messages
- 459
- Solutions
- 1
- Reaction score
- 28
Hello, i have this script to teleport and it just work when i put only one day... what i have to do to work in more than one day?? thanks
Code:
local configuration = {
day = {"tuesday", "thursday", "saturday"},
to_pos = {x = 1021, y = 1074, z = 5}, --Para onde o teleport levará.
pos = {x = 858, y = 750, z = 7}, --Onde o teleport será criado.
teleport_id = 1387, --ID do teleport.
aid = 3434, --Action ID do teleport.
time = 120, --Tempo para fechar, em minutos.
}
function onTime()
if os.date("%A") == configuration.day then
local item = getTileItemById(configuration.pos, configuration.teleport_id).uid
if item < 1 then
local tp = doCreateTeleport(configuration.teleport_id, configuration.to_pos, configuration.pos)
doItemSetAttribute(tp, "aid", configuration.aid)
broadcastMessage("A arena foi aberta.", MESSAGE_STATUS_WARNING)
addEvent(function()
tp = getTileItemById(configuration.pos, configuration.teleport_id).uid
if tp and tp > 0 then
doRemoveItem(tp)
broadcastMessage("A arena foi fechada.")
end
end, configuration.time * 60 * 1000)
end
end
return true
end