local config =
{
days = {"Saturday", "Sunday"},
time = 2 * 60 * 60 * 1000,
door =
{
id = 0,
pos = {x = 0, y = 0, z = 0}
}
}
function onTimer(time)
if (isInArray(config.days)) then
local item = getTileItemById(config.door.pos, config.door.id)
if (item.uid > 0) then
doTransformItem(item.uid, config.door.id + 1)
addEvent(function()
local item = getTileItemById(config.door.pos, config.door.id + 1)
if (item.uid > 0) then
doTransformItem(item.uid, config.door.id)
end
end, time)
end
end
return true
end
local config =
{
days = {"Saturday", "Sunday"},
time = 2 * 60 * 60 * 1000,
door =
{
id = 0,
pos = {x = 0, y = 0, z = 0}
}
}
function onTimer(time)
if (isInArray(config.days)) then
local item = getTileItemById(config.door.pos, config.door.id)
if (item.uid > 0) then
doBroadcastMessage('The door has been opened!')
doTransformItem(item.uid, config.door.id + 1)
addEvent(function()
local item = getTileItemById(config.door.pos, config.door.id + 1)
if (item.uid > 0) then
doBroadcastMessage('The door has been closed!')
doTransformItem(item.uid, config.door.id)
end
end, time)
end
end
return true
end
Ale nie wiem ; <<globalevent name="drzwiczas" time="14:00" event="script" value="drzwiczas.lua"/>