• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

Same old bug..

Majeski20

New Member
Joined
Apr 21, 2008
Messages
602
Reaction score
4
Location
Sweden
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:

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 ++!
 
try this...

LUA:
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
				pos = {x = math.random(from.x, to.x), y = math.random(from.y, to.y), z = math.random(from.z, to.z)}
        doSummonCreature("Deadly Zombie", pos)
        doSendMagicEffect(spawn, CONST_ME_TELEPORT)
        addEvent(Spawn, 20 * 1000)
				return true
			end
		end
	end
	doItemSetAttribute(getTileItemById(TilePos, 1387).uid, 'aid', 7795)
	for _, f in ipairs(getMonstersfromArea(from, to)) do
		doRemoveCreature(getMonsters.uid)
	end
end
 
try this...

LUA:
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
				pos = {x = math.random(from.x, to.x), y = math.random(from.y, to.y), z = math.random(from.z, to.z)}
        doSummonCreature("Deadly Zombie", pos)
        doSendMagicEffect(spawn, CONST_ME_TELEPORT)
        addEvent(Spawn, 20 * 1000)
				return true
			end
		end
	end
	doItemSetAttribute(getTileItemById(TilePos, 1387).uid, 'aid', 7795)
	for _, f in ipairs(getMonstersfromArea(from, to)) do
		doRemoveCreature(getMonsters.uid)
	end
end

Doesnt work..
 
So you added it wrongly

Well, now it almost works, but the zombies does not disappear after winning, they are alive all the time :o!
With this error:
Code:
[Error - GlobalEvent Interface]
In a timer event called from:
data/globalevents/scripts/deadlyArena.lua:49: attempt to index global ´getMonsterstack traceback:
data/globalevents/scripts/deadlyArena.lua:49: in function <data/globalevents/scripts/deadlyArena.lua:34>
 
Back
Top