local maptime = 3600
local warning = 3540
local maps = {
"gm_construct",
"gm_910",
}
local warned
local checkTime()
local players = player.GetAll()
if not warned and CurTime() > warning then
for _, player in ipairs( players ) do
player:PrintMessage( HUD_PRINTTALK, "WARNING: Map will be changed shortly!" )
end
warned = true
end
if CurTime() > maptime then
local nextmap
if table.HasValue( game.GetMap() ) then
for i, map in ipairs( maps ) do
if map == game.GetMap() then
nextmap = maps[ math.fmod( i + 1, #maps ) ]
end
end
else
nextmap = maps[ math.random( #maps ) ]
end
game.ConsoleCommand( "changelevel " .. nextmap .. "\n" )
end
end
timer.Create( "MapRotation", 60, 0, checkTime )
Just a quick untested writeup. Let me know if it doesn't work. You'll need to add whatever maps you want on the rotation into that table, and they'll go in sequence.