Close and ReOpen

kennyubuntu

Member
Joined
May 20, 2016
Messages
96
Best answers
0
Reaction score
5
Someone could help me to my my first script on lua otserver?

I tried:
Code:
<globalevent name="full ss" time="06:00" event="script" value="fullserversave.lua"/>
Code:
function onTime()
   doPlayerBroadcastMessage(cid, 'Server is going down for a global save within 5 minutes. Please logout.')
   addEvent(CloseServer, 5 * 60 * 1000, cid, experience)
   return true
end

function CloseServer()
   local state = GAMESTATE_CLOSED
   doSetGameState(state)
   addEvent(Clean, 5 * 60 * 1000, cid, experience)
   return true
end

function Clean()
   doCleanMap()
   addEvent(OpenServer, 5 * 60 * 1000, cid, experience)
   return true
end

function OpenServer()
   local state = GAMESTATE_NORMAL
   doSetGameState(state)
   return true
end
But:
Code:
[06:00:00.534] [Error - GlobalEvent Interface]
[06:00:00.534] data/globalevents/scripts/fullserversave.lua:onTime
[06:00:00.534] Description:
[06:00:00.534] (luaGetPlayerFlagValue) Player not found
I made all right?
I'm using 0.4
 
Top