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

Auto worldType Change

djtuca

Technical Support
Joined
Jun 25, 2011
Messages
198
Reaction score
3
Location
Brazil
hello,

Its possible create a script that automatically changes worldType per hour?

Example:

from 08:00 AM to 23:00 PM = Open
23:01 PM to 07:59 AM = Enforced

Its possible?
 
add this in globalevent.xml
Lua:
<globalevent name="change" interval="3600" event="script" value="change.lua"/>
add this in globalevent folder
Lua:
function onThink(interval)
if setWorldType(PVP) then
doBroadcastMessage('Gameworld type set to: PVP.', MESSAGE_EVENT_ADVANCE)
end
return true
end
and make another one to change it
 
add this in globalevent.xml
Lua:
<globalevent name="change" interval="3600" event="script" value="change.lua"/>
add this in globalevent folder
Lua:
function onThink(interval)
if setWorldType(PVP) then
doBroadcastMessage('Gameworld type set to: PVP.', MESSAGE_EVENT_ADVANCE)
end
return true
end
and make another one to change it

Is possible maybe, add day? example:

friday= 23:00 pm "hardcore pvp" to saturday= 00:00 am "open pvp".
 
Yup just change the onthink to onTimer and change interval to days you want and don't forget to make a local days
local days = {
[friday] = {12:45:00}
[saturaday] = {1:53:00}
}
and don't forget os.time(%d)
 
tetra,

i not understand but need range of hours

in one day have 2 PVP status
from 08:00 AM to 23:00 PM = Open
23:01 PM to 07:59 AM = Enforced
 
Back
Top