Postado Dezembro 15, 2020 4 anos Rev. 3777 TFS 0.4 8.60 Preciso colocar delay nesse script. Ele ta executando doSaveServer() e doSetGameState(GAMESTATE_SHUTDOWN) ao mesmo então, e isso faz o server fechar sem executar o save. E pra funcionar assim: As 23:55:00 ele inicia o sistema. ai AS 23:59:57 eu queria que ele desse o save e as 00:00:00 o SHUTDOWN. Mostrar conteúdo oculto local globalEvent = 0 local function globalSave(minutes) if minutes <= 0 then doSaveServer() doSetGameState(GAMESTATE_SHUTDOWN) os.exit(0) return true end if minutes == 1 then doBroadcastMessage("Global server save in " .. minutes .. " minute, please go to safe zone and logout. The save will not be longer than 1 minute.") elseif minutes <= 3 then doBroadcastMessage("Global server save in " .. minutes .. " minutes, please go to safe zone. The save will not be longer than 1 minute.") else doBroadcastMessage("Global server save in " .. minutes .. " minutes, please go to safe zone. The save will not be longer than 1 minute.") end globalEvent = addEvent(globalSave, 60000, minutes - 1) return true end function onTime(interval, lastExecution) setGlobalStorageValue(48572, 1) return globalSave(math.abs(math.ceil(5))) end
Postado Dezembro 15, 2020 4 anos Solução local globalEvent = 0 local function globalSave(minutes) if minutes <= 0 then doSetGameState(GAMESTATE_SHUTDOWN) os.exit(0) return true end if minutes == 1 then addEvent(doSaveServer, 59000) -- 59 segundos doBroadcastMessage("Global server save in " .. minutes .. " minute, please go to safe zone and logout. The save will not be longer than 1 minute.") elseif minutes <= 3 then doBroadcastMessage("Global server save in " .. minutes .. " minutes, please go to safe zone. The save will not be longer than 1 minute.") else doBroadcastMessage("Global server save in " .. minutes .. " minutes, please go to safe zone. The save will not be longer than 1 minute.") end globalEvent = addEvent(globalSave, 60000, minutes - 1) return true end function onTime(interval, lastExecution) setGlobalStorageValue(48572, 1) return globalSave(math.abs(math.ceil(5))) end
Participe da conversa
Você pode postar agora e se cadastrar mais tarde. Se você tem uma conta, faça o login para postar com sua conta.