Ir para conteúdo

[Encerrado] (Bug) Invazão System !


Posts Recomendados

Estou com um problema no systema de invazão !!

 

BUG

 

[17/04/2013 18:30:55] [Error - GlobalEvent Interface]

[17/04/2013 18:30:56] In a timer event called from:

[17/04/2013 18:30:56] data/globalevents/scripts/inv.lua:onThink

[17/04/2013 18:30:56] Description:

[17/04/2013 18:30:56] data/globalevents/scripts/inv.lua:110: attempt to index global 'tb' (a nil value)

[17/04/2013 18:30:56] stack traceback:

[17/04/2013 18:30:56] data/globalevents/scripts/inv.lua:110: in function <data/globalevents/scripts/inv.lua:109>

 

 

SCRIPT

 

local days = {

["Sunday"] = {

["00:00"] = {nome = "Mew", pos = {x=746, y=1306, z=4}, monster = {"1 Mew"}, Time = 15},

["02:00"] = {nome = "Moltres", pos = {x=740, y=1286, z=4}, monster = {"1 Moltres"}, Time = 15},

["04:00"] = {nome = "Articuno", pos = {x=710, y=1296, z=4},monster = {"1 Articuno"}, Time = 15},

["08:00"] = {nome = "Zapdos", pos = {x=712, y=1313, z=4},monster = {"1 Zapdos"}, Time = 15},

["10:00"] = {nome = "Mew", pos = {x=718, y=1324, z=4}, monster = {"1 Mew"}, Time = 15},

["12:00"] = {nome = "Moltres", pos = {x=741, y=1320, z=4}, monster = {"1 Moltres"}, Time = 15},

["14:00"] = {nome = "Articuno", pos = {x=745, y=1307, z=4},monster = {"1 Articuno"}, Time = 15},

["16:00"] = {nome = "Zapdos", pos = {x=729, y=1284, z=4},monster = {"1 Zapdos"}, Time = 15},

["18:00"] = {nome = "Mew", pos = {x=728, y=1317, z=4}, monster = {"1 Mew"}, Time = 15},

["20:00"] = {nome = "Moltres", pos = {x=743, y=1289, z=4}, monster = {"1 Moltres"}, Time = 15},

["22:00"] = {nome = "Articuno", pos = {x=710, y=1297, z=4},monster = {"1 Articuno"}, Time = 15},

["23:59"] = {nome = "Zapdos", pos = {x=718, y=1322, z=4},monster = {"1 Zapdos"}, Time = 15},

},

["Saturday"] = {

["00:00"] = {nome = "Mew", pos = {x=746, y=1306, z=4}, monster = {"1 Mew"}, Time = 15},

["02:00"] = {nome = "Moltres", pos = {x=740, y=1286, z=4}, monster = {"1 Moltres"}, Time = 15},

["04:00"] = {nome = "Articuno", pos = {x=710, y=1296, z=4},monster = {"1 Articuno"}, Time = 15},

["08:00"] = {nome = "Zapdos", pos = {x=712, y=1313, z=4},monster = {"1 Zapdos"}, Time = 15},

["10:00"] = {nome = "Mew", pos = {x=718, y=1324, z=4}, monster = {"1 Mew"}, Time = 15},

["12:00"] = {nome = "Moltres", pos = {x=741, y=1320, z=4}, monster = {"1 Moltres"}, Time = 15},

["14:00"] = {nome = "Articuno", pos = {x=745, y=1307, z=4},monster = {"1 Articuno"}, Time = 15},

["16:00"] = {nome = "Zapdos", pos = {x=729, y=1284, z=4},monster = {"1 Zapdos"}, Time = 15},

["18:00"] = {nome = "Mew", pos = {x=728, y=1317, z=4}, monster = {"1 Mew"}, Time = 15},

["20:00"] = {nome = "Moltres", pos = {x=743, y=1289, z=4}, monster = {"1 Moltres"}, Time = 15},

["22:00"] = {nome = "Articuno", pos = {x=710, y=1297, z=4},monster = {"1 Articuno"}, Time = 15},

["23:59"] = {nome = "Zapdos", pos = {x=718, y=1322, z=4},monster = {"1 Zapdos"}, Time = 15},

},

["Monday"] = {

["00:00"] = {nome = "Mew", pos = {x=746, y=1306, z=4}, monster = {"1 Mew"}, Time = 15},

["02:00"] = {nome = "Moltres", pos = {x=740, y=1286, z=4}, monster = {"1 Moltres"}, Time = 15},

["04:00"] = {nome = "Articuno", pos = {x=710, y=1296, z=4},monster = {"1 Articuno"}, Time = 15},

["08:00"] = {nome = "Zapdos", pos = {x=712, y=1313, z=4},monster = {"1 Zapdos"}, Time = 15},

["10:00"] = {nome = "Mew", pos = {x=718, y=1324, z=4}, monster = {"1 Mew"}, Time = 15},

["12:00"] = {nome = "Moltres", pos = {x=741, y=1320, z=4}, monster = {"1 Moltres"}, Time = 15},

["14:00"] = {nome = "Articuno", pos = {x=745, y=1307, z=4},monster = {"1 Articuno"}, Time = 15},

["16:00"] = {nome = "Zapdos", pos = {x=729, y=1284, z=4},monster = {"1 Zapdos"}, Time = 15},

["18:00"] = {nome = "Mew", pos = {x=728, y=1317, z=4}, monster = {"1 Mew"}, Time = 15},

["20:00"] = {nome = "Moltres", pos = {x=743, y=1289, z=4}, monster = {"1 Moltres"}, Time = 15},

["22:00"] = {nome = "Articuno", pos = {x=710, y=1297, z=4},monster = {"1 Articuno"}, Time = 15},

["23:59"] = {nome = "Zapdos", pos = {x=718, y=1322, z=4},monster = {"1 Zapdos"}, Time = 15},

},

["Tuesday"] = {

["00:00"] = {nome = "Mew", pos = {x=746, y=1306, z=4}, monster = {"1 Mew"}, Time = 15},

["02:00"] = {nome = "Moltres", pos = {x=740, y=1286, z=4}, monster = {"1 Moltres"}, Time = 15},

["04:00"] = {nome = "Articuno", pos = {x=710, y=1296, z=4},monster = {"1 Articuno"}, Time = 15},

["08:00"] = {nome = "Zapdos", pos = {x=712, y=1313, z=4},monster = {"1 Zapdos"}, Time = 15},

["10:00"] = {nome = "Mew", pos = {x=718, y=1324, z=4}, monster = {"1 Mew"}, Time = 15},

["12:00"] = {nome = "Moltres", pos = {x=741, y=1320, z=4}, monster = {"1 Moltres"}, Time = 15},

["14:00"] = {nome = "Articuno", pos = {x=745, y=1307, z=4},monster = {"1 Articuno"}, Time = 15},

["16:00"] = {nome = "Zapdos", pos = {x=729, y=1284, z=4},monster = {"1 Zapdos"}, Time = 15},

["18:00"] = {nome = "Mew", pos = {x=728, y=1317, z=4}, monster = {"1 Mew"}, Time = 15},

["20:00"] = {nome = "Moltres", pos = {x=743, y=1289, z=4}, monster = {"1 Moltres"}, Time = 15},

["22:00"] = {nome = "Articuno", pos = {x=710, y=1297, z=4},monster = {"1 Articuno"}, Time = 15},

["23:59"] = {nome = "Zapdos", pos = {x=718, y=1322, z=4},monster = {"1 Zapdos"}, Time = 15},

},

["Wednesday"] = {

["00:00"] = {nome = "Mew", pos = {x=746, y=1306, z=4}, monster = {"1 Mew"}, Time = 15},

["02:00"] = {nome = "Moltres", pos = {x=740, y=1286, z=4}, monster = {"1 Moltres"}, Time = 15},

["04:00"] = {nome = "Articuno", pos = {x=710, y=1296, z=4},monster = {"1 Articuno"}, Time = 15},

["08:00"] = {nome = "Zapdos", pos = {x=712, y=1313, z=4},monster = {"1 Zapdos"}, Time = 15},

["10:00"] = {nome = "Mew", pos = {x=718, y=1324, z=4}, monster = {"1 Mew"}, Time = 15},

["12:00"] = {nome = "Moltres", pos = {x=741, y=1320, z=4}, monster = {"1 Moltres"}, Time = 15},

["14:00"] = {nome = "Articuno", pos = {x=745, y=1307, z=4},monster = {"1 Articuno"}, Time = 15},

["16:00"] = {nome = "Zapdos", pos = {x=729, y=1284, z=4},monster = {"1 Zapdos"}, Time = 15},

["18:00"] = {nome = "Mew", pos = {x=728, y=1317, z=4}, monster = {"1 Mew"}, Time = 15},

["20:00"] = {nome = "Moltres", pos = {x=743, y=1289, z=4}, monster = {"1 Moltres"}, Time = 15},

["22:00"] = {nome = "Articuno", pos = {x=710, y=1297, z=4},monster = {"1 Articuno"}, Time = 15},

["23:59"] = {nome = "Zapdos", pos = {x=718, y=1322, z=4},monster = {"1 Zapdos"}, Time = 15},

},

["Thursday"] = {

["00:00"] = {nome = "Mew", pos = {x=746, y=1306, z=4}, monster = {"1 Mew"}, Time = 15},

["02:00"] = {nome = "Moltres", pos = {x=740, y=1286, z=4}, monster = {"1 Moltres"}, Time = 15},

["04:00"] = {nome = "Articuno", pos = {x=710, y=1296, z=4},monster = {"1 Articuno"}, Time = 15},

["08:00"] = {nome = "Zapdos", pos = {x=712, y=1313, z=4},monster = {"1 Zapdos"}, Time = 15},

["10:00"] = {nome = "Mew", pos = {x=718, y=1324, z=4}, monster = {"1 Mew"}, Time = 15},

["12:00"] = {nome = "Moltres", pos = {x=741, y=1320, z=4}, monster = {"1 Moltres"}, Time = 15},

["14:00"] = {nome = "Articuno", pos = {x=745, y=1307, z=4},monster = {"1 Articuno"}, Time = 15},

["16:00"] = {nome = "Zapdos", pos = {x=729, y=1284, z=4},monster = {"1 Zapdos"}, Time = 15},

["18:00"] = {nome = "Mew", pos = {x=728, y=1317, z=4}, monster = {"1 Mew"}, Time = 15},

["20:00"] = {nome = "Moltres", pos = {x=743, y=1289, z=4}, monster = {"1 Moltres"}, Time = 15},

["22:00"] = {nome = "Articuno", pos = {x=710, y=1297, z=4},monster = {"1 Articuno"}, Time = 15},

["23:59"] = {nome = "Zapdos", pos = {x=718, y=1322, z=4},monster = {"1 Zapdos"}, Time = 15},

},

["Friday"] = {

["00:00"] = {nome = "Mew", pos = {x=746, y=1306, z=4}, monster = {"1 Mew"}, Time = 15},

["02:00"] = {nome = "Moltres", pos = {x=740, y=1286, z=4}, monster = {"1 Moltres"}, Time = 15},

["04:00"] = {nome = "Articuno", pos = {x=710, y=1296, z=4},monster = {"1 Articuno"}, Time = 15},

["08:00"] = {nome = "Zapdos", pos = {x=712, y=1313, z=4},monster = {"1 Zapdos"}, Time = 15},

["10:00"] = {nome = "Mew", pos = {x=718, y=1324, z=4}, monster = {"1 Mew"}, Time = 15},

["12:00"] = {nome = "Moltres", pos = {x=741, y=1320, z=4}, monster = {"1 Moltres"}, Time = 15},

["14:00"] = {nome = "Articuno", pos = {x=745, y=1307, z=4},monster = {"1 Articuno"}, Time = 15},

["16:00"] = {nome = "Zapdos", pos = {x=729, y=1284, z=4},monster = {"1 Zapdos"}, Time = 15},

["18:00"] = {nome = "Mew", pos = {x=728, y=1317, z=4}, monster = {"1 Mew"}, Time = 15},

["20:00"] = {nome = "Moltres", pos = {x=743, y=1289, z=4}, monster = {"1 Moltres"}, Time = 15},

["22:00"] = {nome = "Articuno", pos = {x=710, y=1297, z=4},monster = {"1 Articuno"}, Time = 15},

["23:59"] = {nome = "Zapdos", pos = {x=718, y=1322, z=4},monster = {"1 Zapdos"}, 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*10*60000)

doBroadcastMessage("Cuidado !! Esta Acorrendo Uma Invazao No Castelo Abandonado.")

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

end

 

 

Rep+

Link para o comentário
Compartilhar em outros sites

Tenta assim:

 

 

local tb = {

["Sunday"] = {

["00:00"] = {nome = "Mew", pos = {x=746, y=1306, z=4}, monster = {"1 Mew"}, Time = 15},

["02:00"] = {nome = "Moltres", pos = {x=740, y=1286, z=4}, monster = {"1 Moltres"}, Time = 15},

["04:00"] = {nome = "Articuno", pos = {x=710, y=1296, z=4},monster = {"1 Articuno"}, Time = 15},

["08:00"] = {nome = "Zapdos", pos = {x=712, y=1313, z=4},monster = {"1 Zapdos"}, Time = 15},

["10:00"] = {nome = "Mew", pos = {x=718, y=1324, z=4}, monster = {"1 Mew"}, Time = 15},

["12:00"] = {nome = "Moltres", pos = {x=741, y=1320, z=4}, monster = {"1 Moltres"}, Time = 15},

["14:00"] = {nome = "Articuno", pos = {x=745, y=1307, z=4},monster = {"1 Articuno"}, Time = 15},

["16:00"] = {nome = "Zapdos", pos = {x=729, y=1284, z=4},monster = {"1 Zapdos"}, Time = 15},

["18:00"] = {nome = "Mew", pos = {x=728, y=1317, z=4}, monster = {"1 Mew"}, Time = 15},

["20:00"] = {nome = "Moltres", pos = {x=743, y=1289, z=4}, monster = {"1 Moltres"}, Time = 15},

["22:00"] = {nome = "Articuno", pos = {x=710, y=1297, z=4},monster = {"1 Articuno"}, Time = 15},

["23:59"] = {nome = "Zapdos", pos = {x=718, y=1322, z=4},monster = {"1 Zapdos"}, Time = 15},

},

["Saturday"] = {

["00:00"] = {nome = "Mew", pos = {x=746, y=1306, z=4}, monster = {"1 Mew"}, Time = 15},

["02:00"] = {nome = "Moltres", pos = {x=740, y=1286, z=4}, monster = {"1 Moltres"}, Time = 15},

["04:00"] = {nome = "Articuno", pos = {x=710, y=1296, z=4},monster = {"1 Articuno"}, Time = 15},

["08:00"] = {nome = "Zapdos", pos = {x=712, y=1313, z=4},monster = {"1 Zapdos"}, Time = 15},

["10:00"] = {nome = "Mew", pos = {x=718, y=1324, z=4}, monster = {"1 Mew"}, Time = 15},

["12:00"] = {nome = "Moltres", pos = {x=741, y=1320, z=4}, monster = {"1 Moltres"}, Time = 15},

["14:00"] = {nome = "Articuno", pos = {x=745, y=1307, z=4},monster = {"1 Articuno"}, Time = 15},

["16:00"] = {nome = "Zapdos", pos = {x=729, y=1284, z=4},monster = {"1 Zapdos"}, Time = 15},

["18:00"] = {nome = "Mew", pos = {x=728, y=1317, z=4}, monster = {"1 Mew"}, Time = 15},

["20:00"] = {nome = "Moltres", pos = {x=743, y=1289, z=4}, monster = {"1 Moltres"}, Time = 15},

["22:00"] = {nome = "Articuno", pos = {x=710, y=1297, z=4},monster = {"1 Articuno"}, Time = 15},

["23:59"] = {nome = "Zapdos", pos = {x=718, y=1322, z=4},monster = {"1 Zapdos"}, Time = 15},

},

["Monday"] = {

["00:00"] = {nome = "Mew", pos = {x=746, y=1306, z=4}, monster = {"1 Mew"}, Time = 15},

["02:00"] = {nome = "Moltres", pos = {x=740, y=1286, z=4}, monster = {"1 Moltres"}, Time = 15},

["04:00"] = {nome = "Articuno", pos = {x=710, y=1296, z=4},monster = {"1 Articuno"}, Time = 15},

["08:00"] = {nome = "Zapdos", pos = {x=712, y=1313, z=4},monster = {"1 Zapdos"}, Time = 15},

["10:00"] = {nome = "Mew", pos = {x=718, y=1324, z=4}, monster = {"1 Mew"}, Time = 15},

["12:00"] = {nome = "Moltres", pos = {x=741, y=1320, z=4}, monster = {"1 Moltres"}, Time = 15},

["14:00"] = {nome = "Articuno", pos = {x=745, y=1307, z=4},monster = {"1 Articuno"}, Time = 15},

["16:00"] = {nome = "Zapdos", pos = {x=729, y=1284, z=4},monster = {"1 Zapdos"}, Time = 15},

["18:00"] = {nome = "Mew", pos = {x=728, y=1317, z=4}, monster = {"1 Mew"}, Time = 15},

["20:00"] = {nome = "Moltres", pos = {x=743, y=1289, z=4}, monster = {"1 Moltres"}, Time = 15},

["22:00"] = {nome = "Articuno", pos = {x=710, y=1297, z=4},monster = {"1 Articuno"}, Time = 15},

["23:59"] = {nome = "Zapdos", pos = {x=718, y=1322, z=4},monster = {"1 Zapdos"}, Time = 15},

},

["Tuesday"] = {

["00:00"] = {nome = "Mew", pos = {x=746, y=1306, z=4}, monster = {"1 Mew"}, Time = 15},

["02:00"] = {nome = "Moltres", pos = {x=740, y=1286, z=4}, monster = {"1 Moltres"}, Time = 15},

["04:00"] = {nome = "Articuno", pos = {x=710, y=1296, z=4},monster = {"1 Articuno"}, Time = 15},

["08:00"] = {nome = "Zapdos", pos = {x=712, y=1313, z=4},monster = {"1 Zapdos"}, Time = 15},

["10:00"] = {nome = "Mew", pos = {x=718, y=1324, z=4}, monster = {"1 Mew"}, Time = 15},

["12:00"] = {nome = "Moltres", pos = {x=741, y=1320, z=4}, monster = {"1 Moltres"}, Time = 15},

["14:00"] = {nome = "Articuno", pos = {x=745, y=1307, z=4},monster = {"1 Articuno"}, Time = 15},

["16:00"] = {nome = "Zapdos", pos = {x=729, y=1284, z=4},monster = {"1 Zapdos"}, Time = 15},

["18:00"] = {nome = "Mew", pos = {x=728, y=1317, z=4}, monster = {"1 Mew"}, Time = 15},

["20:00"] = {nome = "Moltres", pos = {x=743, y=1289, z=4}, monster = {"1 Moltres"}, Time = 15},

["22:00"] = {nome = "Articuno", pos = {x=710, y=1297, z=4},monster = {"1 Articuno"}, Time = 15},

["23:59"] = {nome = "Zapdos", pos = {x=718, y=1322, z=4},monster = {"1 Zapdos"}, Time = 15},

},

["Wednesday"] = {

["00:00"] = {nome = "Mew", pos = {x=746, y=1306, z=4}, monster = {"1 Mew"}, Time = 15},

["02:00"] = {nome = "Moltres", pos = {x=740, y=1286, z=4}, monster = {"1 Moltres"}, Time = 15},

["04:00"] = {nome = "Articuno", pos = {x=710, y=1296, z=4},monster = {"1 Articuno"}, Time = 15},

["08:00"] = {nome = "Zapdos", pos = {x=712, y=1313, z=4},monster = {"1 Zapdos"}, Time = 15},

["10:00"] = {nome = "Mew", pos = {x=718, y=1324, z=4}, monster = {"1 Mew"}, Time = 15},

["12:00"] = {nome = "Moltres", pos = {x=741, y=1320, z=4}, monster = {"1 Moltres"}, Time = 15},

["14:00"] = {nome = "Articuno", pos = {x=745, y=1307, z=4},monster = {"1 Articuno"}, Time = 15},

["16:00"] = {nome = "Zapdos", pos = {x=729, y=1284, z=4},monster = {"1 Zapdos"}, Time = 15},

["18:00"] = {nome = "Mew", pos = {x=728, y=1317, z=4}, monster = {"1 Mew"}, Time = 15},

["20:00"] = {nome = "Moltres", pos = {x=743, y=1289, z=4}, monster = {"1 Moltres"}, Time = 15},

["22:00"] = {nome = "Articuno", pos = {x=710, y=1297, z=4},monster = {"1 Articuno"}, Time = 15},

["23:59"] = {nome = "Zapdos", pos = {x=718, y=1322, z=4},monster = {"1 Zapdos"}, Time = 15},

},

["Thursday"] = {

["00:00"] = {nome = "Mew", pos = {x=746, y=1306, z=4}, monster = {"1 Mew"}, Time = 15},

["02:00"] = {nome = "Moltres", pos = {x=740, y=1286, z=4}, monster = {"1 Moltres"}, Time = 15},

["04:00"] = {nome = "Articuno", pos = {x=710, y=1296, z=4},monster = {"1 Articuno"}, Time = 15},

["08:00"] = {nome = "Zapdos", pos = {x=712, y=1313, z=4},monster = {"1 Zapdos"}, Time = 15},

["10:00"] = {nome = "Mew", pos = {x=718, y=1324, z=4}, monster = {"1 Mew"}, Time = 15},

["12:00"] = {nome = "Moltres", pos = {x=741, y=1320, z=4}, monster = {"1 Moltres"}, Time = 15},

["14:00"] = {nome = "Articuno", pos = {x=745, y=1307, z=4},monster = {"1 Articuno"}, Time = 15},

["16:00"] = {nome = "Zapdos", pos = {x=729, y=1284, z=4},monster = {"1 Zapdos"}, Time = 15},

["18:00"] = {nome = "Mew", pos = {x=728, y=1317, z=4}, monster = {"1 Mew"}, Time = 15},

["20:00"] = {nome = "Moltres", pos = {x=743, y=1289, z=4}, monster = {"1 Moltres"}, Time = 15},

["22:00"] = {nome = "Articuno", pos = {x=710, y=1297, z=4},monster = {"1 Articuno"}, Time = 15},

["23:59"] = {nome = "Zapdos", pos = {x=718, y=1322, z=4},monster = {"1 Zapdos"}, Time = 15},

},

["Friday"] = {

["00:00"] = {nome = "Mew", pos = {x=746, y=1306, z=4}, monster = {"1 Mew"}, Time = 15},

["02:00"] = {nome = "Moltres", pos = {x=740, y=1286, z=4}, monster = {"1 Moltres"}, Time = 15},

["04:00"] = {nome = "Articuno", pos = {x=710, y=1296, z=4},monster = {"1 Articuno"}, Time = 15},

["08:00"] = {nome = "Zapdos", pos = {x=712, y=1313, z=4},monster = {"1 Zapdos"}, Time = 15},

["10:00"] = {nome = "Mew", pos = {x=718, y=1324, z=4}, monster = {"1 Mew"}, Time = 15},

["12:00"] = {nome = "Moltres", pos = {x=741, y=1320, z=4}, monster = {"1 Moltres"}, Time = 15},

["14:00"] = {nome = "Articuno", pos = {x=745, y=1307, z=4},monster = {"1 Articuno"}, Time = 15},

["16:00"] = {nome = "Zapdos", pos = {x=729, y=1284, z=4},monster = {"1 Zapdos"}, Time = 15},

["18:00"] = {nome = "Mew", pos = {x=728, y=1317, z=4}, monster = {"1 Mew"}, Time = 15},

["20:00"] = {nome = "Moltres", pos = {x=743, y=1289, z=4}, monster = {"1 Moltres"}, Time = 15},

["22:00"] = {nome = "Articuno", pos = {x=710, y=1297, z=4},monster = {"1 Articuno"}, Time = 15},

["23:59"] = {nome = "Zapdos", pos = {x=718, y=1322, z=4},monster = {"1 Zapdos"}, 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*10*60000)

doBroadcastMessage("Cuidado !! Esta Acorrendo Uma Invazao No Castelo Abandonado.")

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

end

 

Link para o comentário
Compartilhar em outros sites

Agora deu bug nesta linha =s

 

[18/04/2013 00:21:14] [Error - GlobalEvent Interface]

[18/04/2013 00:21:14] data/globalevents/scripts/inv.lua:onThink

[18/04/2013 00:21:14] Description:

[18/04/2013 00:21:14] data/globalevents/scripts/inv.lua:107: attempt to index global 'days' (a nil value)

[18/04/2013 00:21:14] stack traceback:

[18/04/2013 00:21:14] data/globalevents/scripts/inv.lua:107: in function <data/globalevents/scripts/inv.lua:101>

[18/04/2013 00:21:14] [Error - GlobalEvents::think] Couldn't execute event: Invasao

 

Link para o comentário
Compartilhar em outros sites

  • 5 years later...
A questão neste tópico de suporte foi encerrada por falta de respostas. Este tópico está fechado e foi movido para Suporte - Tópicos Sem Resposta.

+ Caso a dúvida não tenha sido resolvida você poderá criar outro tópico solicitando ajuda.
* Lembre-se que é permitido dar UP no tópico a cada 24 horas para assim o destacar e manter movimentado.
Link para o comentário
Compartilhar em outros sites

Visitante
Este tópico está impedido de receber novos posts.
×
×
  • Criar Novo...