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

Change Worldtype every x Days to start PvP Events

Solution
For a TFS 1.2, but your script is to start for example now with a duration 60 minutes with PVP_ENF true? also is posible to add every days like automated event?
My idea is for just people play every week with gameworld pvp and every weekends server changes to pvp enfo without change manualy the config.lua (this is to prevent if I forget to change it on Sunday and start with pvpenf on Monday XD)

Pay attention in script scope.
Every day in X time (hour:minute:second) - 10:00:00 the server will be PVP Enforced for 60 minutes.
XML:
<globalevent name="PvPevent" time="10:00:00" script="pvpEvent.lua" />
very 3 weekends server change to world type: Hardcore-PvP... Globalevent can do it?
You should always include what distro you are requesting scripts for, someone from 2008 with over 900 messages should know this. Also this explanation is lacking, idk if you want it to last the whole weekend, or if it should be on startup or at a certain time.

This should be the general idea on how to do it:
Lua:
local global_storage = 9000
local duration = 60 -- in minutes

function onTime(interval)
    local time = os.time()
    if Game.getStorageValue(global_storage) >= time then
        Game.setWorldType(WORLD_TYPE_PVP_ENFORCED)
        Game.setStorageValue(global_storage, time + (3 * 7 * 24 * 60 * 60))
        addEvent(function()
            Game.setWorldType(WORLD_TYPE_PVP)
        end, duration * 60 * 1000)
    end
    return true
end
 
For a TFS 1.2, but your script is to start for example now with a duration 60 minutes with PVP_ENF true? also is posible to add every days like automated event?
My idea is for just people play every week with gameworld pvp and every weekends server changes to pvp enfo without change manualy the config.lua (this is to prevent if I forget to change it on Sunday and start with pvpenf on Monday XD)
 
For a TFS 1.2, but your script is to start for example now with a duration 60 minutes with PVP_ENF true? also is posible to add every days like automated event?
My idea is for just people play every week with gameworld pvp and every weekends server changes to pvp enfo without change manualy the config.lua (this is to prevent if I forget to change it on Sunday and start with pvpenf on Monday XD)

Pay attention in script scope.
Every day in X time (hour:minute:second) - 10:00:00 the server will be PVP Enforced for 60 minutes.
XML:
<globalevent name="PvPevent" time="10:00:00" script="pvpEvent.lua" />
 
Solution
This isn't going to change world type every day. You can see I'm setting a storage with os.time() to 3 weeks later because OP said every 3 weekends. This script will only activate three weeks after it was previously activated. However it seems OP wants differently now, if he want it to activate every weekend then there's a better way.

onStartup with a check to see if day is saturday or sunday is best.
 
Back
Top