editado, bug removido:
days = {
["Monday"] = {
["21:30"] = {nome = "Orshabaal", pos = {{x=184, y=55, z=7},{x=188, y=58, z=7}}, m = {5, "Orshabaal"}, Time = 1},
["21:33"] = {nome = "Dragon", pos = {{x=197, y=57, z=7},{x=203, y=60, z=7}}, m = {7, "Dragon"}, Time = 2}
},
["Tuesday"] = {
["21:03"] = {nome = "Demon", pos = {{x=184, y=55, z=7},{x=188, y=58, z=7}}, m = {5, "Demon"}, Time = 15},
["21:05"] = {nome = "Hydra", pos = {{x=197, y=57, z=7},{x=203, y=60, z=7}}, m = {7, "Hydra"}, Time = 20}
}
}
function onThink(interval, lastExecution)
hours = tostring(os.date("%X")):sub(1, 5)
if days[os.date("%A")] then
tb = days[os.date("%A")][hours]
if tb then
function removeCreature(tb)
for x = ((tb.pos[1].x)-10), ((tb.pos[2].x)+10) do
for y = ((tb.pos[1].y)-10), ((tb.pos[2].y)+10) do
local m = getTopCreature({x=x, y=y, z= tb.pos[1].z}).uid
if m ~= 0 and isMonster(m) then
doRemoveCreature(m)
end
end
end
end
doBroadcastMessage("A invasão " .. tb.nome .. " começou")
for i = 1, tb.m[1] do
pos = {x = math.random(tb.pos[1].x, tb.pos[2].x), y = math.random(tb.pos[1].y, tb.pos[2].y), z = math.random(tb.pos[1].z, tb.pos[2].z)}
doCreateMonster(tb.m[2], pos)
end
addEvent(removeCreature, tb.Time*60*1000, tb)
end
end
return true
end
{nome = "Orshabaal", pos = {{x=184, y=55, z=7},{x=188, y=58, z=7}}, m = {5, "Orshabaal"}, Time = 15},
pos = {{x=184, y=55, z=7},{x=188, y=58, z=7}}
tem duas pos aí, é o começo e o final da onde vai acontecer a invasão(pos)
m = {5, "Orshabaal"}
é quantos monstro vão ser sumonados e o nome do monstro
ou




info
Grupo: Conde
Registrado: 10/07/08
Posts: 574
Reputação: +13
Gênero: Masculino
Char no Tibia: Hebi Of Amera
Está dando o seguinte erro quando liga.
Fica dando esse erro direto, lê na internet que falta complementar com o script, como não sei muito de .lua vim pedir a ajuda da xtibia. Valeu
local days = { ["monday"] = { ["13:00"] = {nome = "Orshabaal", pos = {x=33222, y=31717, z=7}, monster = {"1 Orshabaal"}, Time = 15}, ["12:59"] = {nome = "Orshabaal", pos = {x=33222, y=31717, z=7}, monster = {"1 Demon"}, Time = 15}, ["12:58"] = {nome = "Orshabaal", pos = {x=33222, y=31717, z=7}, monster = {"1 Demon"}, Time = 15}, ["12:57"] = {nome = "Orshabaal", pos = {x=33222, y=31717, z=7}, monster = {"1 Demon"}, Time = 15}, ["12:56"] = {nome = "Orshabaal", pos = {x=33222, y=31717, z=7}, monster = {"1 Demon"}, Time = 15}, ["12:55"] = {nome = "Orshabaal", pos = {x=33222, y=31717, z=7}, monster = {"1 Demon"}, Time = 15}, } } function onThink(interval, lastExecution) function getDayName() local days = {"Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"} return days[os.date("*t")["wday"]] end hours = tostring(os.date("%X")):sub(1, 5) tb = days[getDayName()][hours] if tb then function removeCreature() for x = ((tb.pos.x)-10), ((tb.pos.x)+10) do for y = ((tb.pos.y)-10), ((tb.pos.y)+10) do local m = getTopCreature({x=x, y=y, z= tb.pos.z}).uid if m ~= 0 and isMonster(m) then doRemoveCreature(m) end end end return true end addEvent(removeCreature, tb.Time*60*1000) doBroadcastMessage(" " .. tb.nome .. " ") for _,x in pairs(tb.monster) do for s = 1, tonumber(x:match("%d+")) do doSummonCreature(x:match("%s(.+)"), tb.pos) end end end return true endAlguém ajuda ai?
alguém ajuda ai?