How would I make a change map script that changes map randomly? Like, I made 4 different maps, I want it to make 3 disappear and 1 appear and you spawn on it and play for 3 minutes, than change to a random map?
How to make a change map script to random map?
2 answers
You can generate the map into a folder in roblox and move the folders in and out of the ServerStorageService.
Objects moved there will stay in the position but do not exist in the Workspace so cannot be interacted.
I am guessing you are generating all four and switching them out every 3 minuits so each folder can be moved like this
local Map1 = Workspace.Map1--Map1 is the name of the folder you stored map1
local Map2 = Workspace.Map2--Map2 is the name of the folder you stored map2
local Map3 = Workspace.Map3--Map3 is the name of the folder you stored map3
local Map4 = Workspace.Map4--Map4 is the name of the folder you stored map4
Map2.Parent = game.ServerStorage
Map3.Parent = game.ServerStorage
Map4.Parent = game.ServerStorage
wait(180)
Map1.Parent = game.ServerStorage
Map2.Parent = game.Workspace
wait(180)
Map2.Parent = game.ServerStorage
Map3.Parent = game.Workspace
wait(180)
Map3.Parent = game.ServerStorage
Map4.Parent = game.Workspace
Next time, put an attempt at the script first so you don't get flagged. But this is the script. It's randomized as it can be.
Make a folder directly in Workspace called "MapHolder"
local Map1 = game.ServerStorage:FindFirstChild("1")--change the number to the map names, just copy and paste to add more.
local Map2 = game.ServerStorage:FindFirstChild("2")
local Map3 = game.ServerStorage:FindFirstChild("3")
local Map4 = game.ServerStorage:FindFirstChild("4")
local maps = {"1", "2", "3", "4"}--Add to this is you make another map
while true do
wait(1)
local newmap = math.random(1, #maps)
if newmap = 1 then
Map1.Parent = game.Workspace.MapHolder
wait(180)
elseif newmap = 1 then
Map2.Parent = game.Workspace.MapHolder
wait(180)
elseif newmap = 1 then
Map3.Parent = game.Workspace.MapHolder
wait(180)
elseif newmap = 1 then
Map4.Parent = game.Workspace.MapHolder
wait(180)
end
--Copy the 3 line above and replace the "Map4" with your new map(probably Map5) to add another one. Delete the end inbetween.
game.Workspace.MapHolder:ClearAllChildren()
break
end
Please accept if it helped, Ask questions too.
1 comment
Why would you make a wait 180? What if the map 2-4 was chosen? The script looks like it will have to wait over 2 minutes to check.
This discussion is preserved as it was. New answers, comments, and votes are closed.

2 comments
Paste the folders into ServerScriptService, or ServerStorage?
While this may work it won't fit the criteria of a map changing script in a mini-game....