I know this is a HUGE FAVOR, but I really want to know. A friend and I are trying to develop a game and we need to know how to make maps switch around a bit (to add variety, of course!) and we currently have four or so. If you can reply with a concept of the script (no need for the whole script, i can never learn if i just get things handed to me) i'll be eternally grateful. Thanks.
What you would need to do: Put all the maps into Lighting/ServerStorage
Put all the maps into a table, use math.random, and then load it into Workspace.
A script if you want it:
--[[ All you need to do is put all the maps into Lighting, and name them "Map" + a random number Example: > Lighting -->Map1 -->Map2 etc ]]-- maps = {} function LoadMaps() for i,v in pairs(game.Lighting:GetChildren()) do if string.lower(string.sub(v,1,3)) == "map" then table.insert(maps, v.Name) end end end LoadMaps() function SelectMap() local n = math.random(1,#maps) local map = game.Lighting:FindFirstChild(maps[n]) local newmap = map:Clone() newmap.Parent = game.Workspace end SelectMap()
Well, first of all, would you like it to be randomly selected, and how many maps are there? And do you want a hint appearing saying: LOADING:(MAP NAME)?