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

Close and ReOpen

kennyubuntu

Member
Joined
May 20, 2016
Messages
110
Best answers
0
Reaction score
7
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