<?xml version="1.0" encoding="UTF-8"?>
<globalevents>
<globalevent name="globalsave" time="17:06:00" event="script" value="save.lua"/>
</globalevents>
save.lua
function prepareShutdown(minutes) if(minutes <= 0) then
doSetGameState(GAMESTATE_CLOSED)
return false
end
if(minutes == 1) then
doBroadcastMessage("Server is going down in " .. minutes .. " minute for global save, please log out now!")
elseif(minutes <= 3) then
doBroadcastMessage("Server is going down in " .. minutes .. " minutes for global save, please log out.")
else
doBroadcastMessage("Server is going down in " .. minutes .. " minutes for global save.")
end
shutdownEvent = addEvent(prepareShutdown, 60000, minutes - 1)
return true
end
function onTime(interval)
if os.date('%H') == "3" and getWorldUpTime() > 20*60*60 then
return prepareShutdown(10)
end
return TRUE
end
Estou fazendo alguma coisa errada?
chega no horário e não aparece nenhuma mensagem
+rep