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

Zombie Event (add Ontime fuction)

vvglex

New Member
Joined
Jan 2, 2015
Messages
162
Reaction score
2
Hey i want help now my zombie event is like this local autoStartInterval = 60 -- time between arenas in minutes, default 60 = 1 hour

i want it so i can add this in globalevents <globalevent name="zombieevent" time="23:04:00" event="script" value="zombie/onstartup_autostart.lua"/> -->


script
Code:
local autoStartInterval = 60 -- time between arenas in minutes, default 60 = 1 hour

function onThink(interval, lastExecution, thinkInterval)
if(getStorage(ZE_STATUS) ~= 2) then
if(getStorage(45267)+autoStartInterval*60 <= os.time() and getStorage(45268) ~= 1) then
doSetStorage(45268, 1)
removeZombiesEventBlockEnterPosition()
doSetStorage(ZE_STATUS, 1)
doBroadcastMessage("Zombie Arena Event teleport will be opened for 2 minutes. We are waiting for " .. getZombiesEventPlayersLimit() - #getZombiesEventPlayers() .. " players to start.")
elseif(getStorage(45267)+autoStartInterval*60+120 <= os.time() and getStorage(45268) == 1) then
addZombiesEventBlockEnterPosition()
doSetStorage(45268, 0)
doSetStorage(ZE_STATUS, 2)
doSetStorage(45267, os.time())
doBroadcastMessage("Zombie Arena Event started.")
end
end
return true
end

bump
 
Last edited by a moderator:
Thanks i use tfs 0.4 :)

Which server do you use? Change onThink to onTimer or onTime (depense on server version).
it only says this when i start the server

Code:
[Warning - Event::loadScript] Event onTime not found (data/globalevents/scripts/zombie/onstartup_autostart.lua)
 
Last edited by a moderator:
Change onThink to onTime.
[Error - GlobalEvent Interface]
data/globalevents/scripts/zombie/onthink_autostart.lua:onTime
Description:
...ta/globalevents/scripts/zombie/onthink_autostart.lua:3: attempt to perform arithmetic on global 'autoStartInterval' (a nil value)
stack traceback:
...ta/globalevents/scripts/zombie/onthink_autostart.lua:3: in function <...ta/globalevents/scripts/zombie/onthink_autostart.lua:1>
[Error - GlobalEvents::timer] Couldn't execute event: ZombieGlobalThink_AutoStart
 
Did you remove the variable "local autoStartInterval = 60" at the top? f you did, add it back.
oh i did that sorry but what time should it be?

does it matter what local autoStartInterval = 60 it is? 60 or whatever?
@Limos

Did you remove the variable "local autoStartInterval = 60" at the top? f you did, add it back.
sorry limos but the server dont start the event on that time :/ and no error code :/
 
Last edited by a moderator:
Back
Top