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

Lua Auto World Type Changer

SoloQ

Hard With Style
Joined
Mar 12, 2009
Messages
557
Reaction score
21
Location
Netherlands ;3
Auto World Type Changer

Hi, I am kinda stuk in a auto world type changer I want it in the weekdays to be on PVP and in the weekend PvP-E.

Who can help? I would appreciate it.
 
just use a simple globalevent a time based one which check every 12 am for the day and the type
LUA:
local weekend = {"friday","saturday"}  -- all uncapitalized , this will be the days of PVP-e
function onTimer()  -- onTime for 0.4 server
	if isInArray(weekend,string.lower(os.date("%A"))) and getWorldType(getConfigValue(worldId)) ~= 3 then 
		setWorldType(3)
		doBroadcastMessage("World type was set to PVP-enforced.")
	elseif not isInArray(weekend,string.lower(os.date("%A"))) and getWorldType(getConfigValue(worldId)) ~= 2 then
		setWorldType(2)
		doBroadcastMessage("World type was set to PVP.")
	end
	return true
end
 
Back
Top