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:
01 | --[[ |
02 | All you need to do is put all the maps into Lighting, and name them "Map" + a random number |
03 | Example: |
04 | > Lighting |
05 | -->Map1 |
06 | -->Map2 |
07 | etc |
08 | ]] -- |
09 | maps = {} |
10 |
11 | function LoadMaps() |
12 | for i,v in pairs (game.Lighting:GetChildren()) do |
13 | if string.lower(string.sub(v, 1 , 3 )) = = "map" then |
14 | table.insert(maps, v.Name) |
15 | end |
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)?