Okay guys, ill make this fast.
My zombie event finally started working 100% as i wanted for some days, then my console started to crash alot for another reason, so i changed
console, and now i got the same zombie error! :S
ERROR:
globalevents.lua
happy to get quick answers!
Thanks in advance, rep ++!
My zombie event finally started working 100% as i wanted for some days, then my console started to crash alot for another reason, so i changed
console, and now i got the same zombie error! :S
ERROR:
Code:
[Error - Globalevent Inferface]
In a timer event called from:
data/globalevents/scripts/deadlyArena.lua:onThink
Description:
data/globalevents/scripts/deadlyArena.lua:47 attempt to call global ´getMonstersfromArea´ <a nil value>
stack traceback:
data/globalevents/scripts/deadlyArena.lua:47: in function ´spawn´
data/globalevents/scripts/deadlyArena.lua:31: in function <data/globalevents/scripts/deadlyArena.lua:27>
globalevents.lua
Code:
local TilePos = {x=1005, y=1002, z=7}
local spawn = {x=1145, y=922, z=7}
local from = {x = 1131, y = 913, z =7}
local to = {x = 1161, y = 930, z=7}
function onThink(interval, lastExecution, thinkInterval)
doBroadcastMessage('Deadly Zombie event will start after 3 minutes! The teleport to arena is located in temple.', MESSAGE_EVENT_ADVANCE)
addEvent(BC2, 1 * 60 * 1000)
return true
end
function BC2()
doBroadcastMessage('Deadly Zombie event will start after 2 minutes! The teleport to arena is located in temple.', MESSAGE_EVENT_ADVANCE)
addEvent(BC3, 1 * 60 * 1000)
end
function BC3()
doBroadcastMessage('Deadly Zombie event will start after 1 minutes! The teleport to arena is located in temple. You can\'t enter arena during the event, so hurry up and don\'t be late!', MESSAGE_EVENT_ADVANCE)
addEvent(BC4, 1 * 60 * 1000)
end
function BC4()
doItemSetAttribute(getTileItemById(TilePos, 1387).uid, 'aid', 7796)
doBroadcastMessage('The event started and Deadly Zombie are being summoned. Winner is the player who dies last. Good luck!', MESSAGE_EVENT_ADVANCE)
doSendMagicEffect(TilePos, 6)
Spawn()
end
function Spawn()
for x = from.x, to.x do
for y = from.y, to.y do
local a = getTopCreature({x=x, y=y, z=7}).uid
if a ~= 0 and isPlayer(a) then
addEvent(Spawn, 20 * 1000)
doCreateMonster('Deadly Zombie', spawn)
doSendMagicEffect(spawn, CONST_ME_TELEPORT)
return true
end
end
end
doItemSetAttribute(getTileItemById(TilePos, 1387).uid, 'aid', 7795)
for _, f in ipairs(getMonstersfromArea(from, to)) do
doRemoveCreature(f)
end
end
happy to get quick answers!
Thanks in advance, rep ++!