• 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!
  • 2026 staff recruitment is open! Check it out and consider applying!

auto start zombie event

Create new .lua in globalevent and add this
Code:
function onThink(interval, lastExecution)
local players_on_arena_count = #getZombiesEventPlayers()

local function start()
setZombiesEventPlayersLimit(players_on_arena_count )
addZombiesEventBlockEnterPosition()
doSetStorage(ZE_STATUS, 2)
doBroadcastMessage("Zombie Arena Event started")
return true
end
setZombiesEventPlayersLimit(10)
doBroadcastMessage("Zombie Event Is Waiting For " .. getZombiesEventPlayersLimit() - players_on_arena_count .. " To Join.Zombie Will Start In 5 Minutes")
removeZombiesEventBlockEnterPosition()
addEvent(start,5*60*1000)
doSetStorage(ZE_STATUS, 1)
return true
end

and in globalevents.xml
0.4
Code:
<globalevent name="zombiestart" interval="7200000" script="zombiestart.lua"/>
0.3.6
Code:
<globalevent name="zombiestart" interval="7200" script="zombiestart.lua"/>
 
Create new .lua in globalevent and add this
Code:
function onThink(interval, lastExecution)
local players_on_arena_count = #getZombiesEventPlayers()

local function start()
setZombiesEventPlayersLimit(players_on_arena_count )
addZombiesEventBlockEnterPosition()
doSetStorage(ZE_STATUS, 2)
doBroadcastMessage("Zombie Arena Event started")
return true
end
setZombiesEventPlayersLimit(10)
doBroadcastMessage("Zombie Event Is Waiting For " .. getZombiesEventPlayersLimit() - players_on_arena_count .. " To Join.Zombie Will Start In 5 Minutes")
removeZombiesEventBlockEnterPosition()
addEvent(start,5*60*1000)
doSetStorage(ZE_STATUS, 1)
return true
end

and in globalevents.xml
0.4
Code:
<globalevent name="zombiestart" interval="7200000" script="zombiestart.lua"/>
0.3.6
Code:
<globalevent name="zombiestart" interval="7200" script="zombiestart.lua"/>

THAT found good but have one error, on my config my getZombiesEventPlayers=5 but the event when start that need 9 players and dont 5?,
 
Code:
function onThink(interval, lastExecution)
local players_on_arena_count = #getZombiesEventPlayers()

local function start()
setZombiesEventPlayersLimit(players_on_arena_count )
addZombiesEventBlockEnterPosition()
doSetStorage(ZE_STATUS, 2)
doBroadcastMessage("Zombie Arena Event started")
return true
end
setZombiesEventPlayersLimit(ZE_DEFAULT_NUMBER_OF_PLAYERS)
doBroadcastMessage("Zombie Event Is Waiting For " .. getZombiesEventPlayersLimit() - players_on_arena_count .. " To Join.Zombie Will Start In 5 Minutes")
removeZombiesEventBlockEnterPosition()
addEvent(start,5*60*1000)
doSetStorage(ZE_STATUS, 1)
return true
end
 
Code:
function onThink(interval, lastExecution)
local players_on_arena_count = #getZombiesEventPlayers()

local function start()
setZombiesEventPlayersLimit(players_on_arena_count )
addZombiesEventBlockEnterPosition()
doSetStorage(ZE_STATUS, 2)
doBroadcastMessage("Zombie Arena Event started")
return true
end
setZombiesEventPlayersLimit(ZE_DEFAULT_NUMBER_OF_PLAYERS)
doBroadcastMessage("Zombie Event Is Waiting For " .. getZombiesEventPlayersLimit() - players_on_arena_count .. " To Join.Zombie Will Start In 5 Minutes")
removeZombiesEventBlockEnterPosition()
addEvent(start,5*60*1000)
doSetStorage(ZE_STATUS, 1)
return true
end

found good, thanks <3, other question what is the inteval for 3 hours?,


other problem, when event start, the globalevent dont stop spam zombie event is waiting, and that dont wait the 5 min for start when have the number of player on ''zone'' that start



23:53 Zombie Arena Event started.
23:54 Zombie Event Is Waiting For 0 To Join.Zombie Will Start In 5 Minutes
 
Code:
function onThink(interval, lastExecution)
local players_on_arena_count = #getZombiesEventPlayers()

local function start()
if players_on_arena_count <= 1 then
doBroadcastMessage("Zombie Couldn't Start Because there was few numbers ona rena")
doSetStorage(ZE_STATUS, 0)
addZombiesEventBlockEnterPosition()
return true
end
setZombiesEventPlayersLimit(players_on_arena_count)
addZombiesEventBlockEnterPosition()
doSetStorage(ZE_STATUS, 2)
doBroadcastMessage("Zombie Arena Event started")
return true
end
setZombiesEventPlayersLimit(5)
doBroadcastMessage("Zombie Event Is Waiting For 5 Players To Join.Zombie Will Start In 5 Minutes")
removeZombiesEventBlockEnterPosition()
addEvent(start,5*60*1000)
doSetStorage(ZE_STATUS, 1)
return true
end

Code:
<globalevent name="zombiestart" interval="10800" script="zombiestart.lua"/>
 
Back
Top