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

Zombie event - NEW version, bug free, updated

ZE_blockEnterItemPosition = {x= 873, y=997, z=7}
ZE_enterPosition = {x = 1638, y = 1530, z = 7}
ZE_kickPosition = {x=874, y=994, z=7}
ZE_spawnFromPosition = {x = 1617, y = 1514, z = 7}
ZE_spawnToPosition = {x = 1671, y = 1565, z = 7}



please explain!
 
Great script! Thanks very much!

For any one with this error:
Code:
[28/06/2012 12:36:49] [Error - CreatureScript Interface] 
[28/06/2012 12:36:49] data/creaturescripts/scripts/zombie/onthink.lua:onThink
[28/06/2012 12:36:49] Description: 
[28/06/2012 12:36:49] (luaGetCreatureTarget) Creature not found

The issue is onEvent still being executed when the creature is no longer there I think...
This fixes it:
Code:
function onThink(cid)
	if cid == 0 then return true end	
	local target = getCreatureTarget(cid)
	if(target ~= 0 and not isPlayer(target)) then
		doRemoveCreature(target)
	end
	return true
end
 
Alright so after many hours of none stop trying to figure out why the Zombies would not disappear once the Event ended i did find out how to fix this.

So first off near the top of the lib you will see something like this.

ZE_spawnFromPosition = {x = 1037, y = 1070, z = 7} - Make Positions Very Top Left corner of you're Zombie Arena Map.
ZE_spawnToPosition = {x = 1066, y = 1095, z = 7} - Make Positions Very Bottom Right corner of you're Zombie Arena Map.

Replace old Script.

function onThink(cid)
local target = getCreatureTarget(cid)
if(target ~= 0 and not isPlayer(target)) then
doRemoveCreature(target)
end
return true
end

New Script.

function onThink(cid)
local target = getCreatureTarget(cid)
if(target ~= 0 and not isPlayer(target)) then
doRemoveCreature(creatures)
end
return true
end

If anyone still had this issue and this has fixed it please post and let me know if it helped thanks.
 
Last edited:
Well, i entered the zombie area and no zombie spawns, it say zombie event started but i dont see any zombies? any idé? maybe some1 can add me skype and guide me or even teamviewer!
my name on skype is : Bassam4211

- - - Updated - - -

Fixed :p

- - - Updated - - -

when i die in the event i die IRL too, and zombies keep on spawning, i used to code abow but didnt work :S
 
it keeps crashing for me at the end of the event with no errors at all... i am using 0.4 revs
 
[23/01/2013 14:36:24] [Error - GlobalEvent Interface]
[23/01/2013 14:36:24] data/globalevents/scripts/onthink.lua:eek:nThink
[23/01/2013 14:36:24] Description:
[23/01/2013 14:36:24] data/lib/zombie_event.lua:104: bad argument #2 to 'random' (interval is empty)
[23/01/2013 14:36:24] stack traceback:
[23/01/2013 14:36:24] [C]: in function 'random'
[23/01/2013 14:36:25] data/lib/zombie_event.lua:104: in function 'spawnNewZombie'
[23/01/2013 14:36:25] data/globalevents/scripts/onthink.lua:6: in function <data/globalevents/scripts/onthink.lua:1>
[23/01/2013 14:36:25] [Error - GlobalEvents::think] Couldn't execute event: ZombieGlobalThink



tfs 0.3.6 please fix this
 
I need help bcs when i start zombie event and players go in, it send massage that zombie arena has started but didnt spawn monsters... how can i fix it??
 
How to auto-start Zombie Event every Sunday at 21:00 ?
I don't have any OTS now, so I can't test, but I hope that code works fine.
With example config it should run zombie event 2 times every week at 'saturday, 19:30' and 'sunday, 21:00'
Lua:
--[[
day_of_week: 0 = Sunday, 1 = Monday ... 6 = Saturday
hour: value between 0 and 23
minute: value between 0 and 59
storage: unique, not used global storage value
--]]

local autoStartsTable = {
{["day_of_week"] = 6, ["hour"] = 19, ["minute"] = 30, ["storage"] = 7867},
{["day_of_week"] = 0, ["hour"] = 21, ["minute"] = 0, ["storage"] = 7868}
}

function shouldExecuteEvent(configTable)
	for _, config in pairs(configTable) do
		if(tonumber(os.date("%d")) ~= getStorage(config.storage) and tonumber(os.date("%w")) == config.day_of_week) then
			if(tonumber(os.date("%H")) == config.hour and tonumber(os.date("%M")) == config.minute) then
				doSetStorage(config.storage, tonumber(os.date("%d")))
				return true
			end
		end
	end
	return false
end

function onThink(interval, lastExecution, thinkInterval)
	if(shouldExecuteEvent(autoStartsTable)) then
		if(getStorage(ZE_STATUS) ~= 1 and getStorage(ZE_STATUS) ~= 2) then
			removeZombiesEventBlockEnterPosition()
			doSetStorage(ZE_STATUS, 1)
			doBroadcastMessage("Zombie Arena Event teleport will be open for 2 minutes. We are waiting for " .. getZombiesEventPlayersLimit() - #getZombiesEventPlayers() .. " players to start.")
			addEvent(startArenaEvent, 120 * 1000)
		end
	end
	return true
end

function startArenaEvent()
	if(getStorage(ZE_STATUS) == 1) then
		addZombiesEventBlockEnterPosition()
		doSetStorage(ZE_STATUS, 2)
		doBroadcastMessage("Zombie Arena Event started.")
	end
end
Add it as globalevent 'think' and execute every 30 seconds.
 
how to add blocked in event use runes magic wall (ID 2293) and 2272 ?
My data/spells/scripts/support/magic wall rune.lua:
Lua:
local combat = createCombatObject()
setCombatParam(combat, COMBAT_PARAM_DISTANCEEFFECT, CONST_ANI_ENERGY)
setCombatParam(combat, COMBAT_PARAM_CREATEITEM, 1497)
setCombatParam(combat, COMBAT_PARAM_AGGRESSIVE, FALSE)

function onCastSpell(cid, var)
	if(getPlayerZombiesEventStatus(cid) <= 0) then
		return doCombat(cid, combat, var)
	else
		return false
	end
end
You can modify other spells like that to disable them for players that are on zombie event arena.
 
I think its script can be better if spawn of zombies is for x,y,z to x,y,z and to remove zombies (other area) is for x2,y2,z2 to x2,y2,z2

 
Last edited:
please explain these lines
ZE_blockEnterItemPosition = {x= 873, y=997, z=7}
ZE_enterPosition = {x = 1638, y = 1530, z = 7}
ZE_kickPosition = {x=874, y=994, z=7}

- - - Updated - - -

find out myself , works 100% atm :)
 
Back
Top