• 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!

Lua Why this event bug? :(

Majeski20

New Member
Joined
Apr 21, 2008
Messages
602
Reaction score
4
Location
Sweden
[26/05/2011 10:12:04] [Error - GlobalEvent Interface]
[26/05/2011 10:12:04] In a timer event called from:
[26/05/2011 10:12:04] data/globalevents/scripts/deadlyArena.lua:onThink
[26/05/2011 10:12:04] Description:
[26/05/2011 10:12:04] (luaDoRemoveCreature) Creature not found


Why do i get this when the event restarts?
Please help me ! :(

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(t)
	end
end
 
Back
Top