I think I'm on my phone so I cant test but map1 would be your map obviously
game.serverstorage.map1:Clone(Workspace)
I'm unsure what you mean by randomly selecting a map, but to move a map into the workspace you would use something like this
local map = game.ServerStorage.map map:Clone(Workspace)
this would make a clone of the map and move it into the workspace(so that you could destroy the map and clone it again, effectively resetting the map), but if you just wanted to move the whole thing and not make a duplicate of it, you would just remove the :Clone() so it looked like this
local map = game.ServerStorage.map map.Parent = game.Workspace
If you have any questions just let me know and I'll do my best to answer them.
:getChildren() of your storage folder and then use math.random to select an index number to clone?
then just do
local map = game:GetSeervice("ReplicatedStorage"). *the output from the table* local choice = map:clone() choice.Parent game.Workspace
? idk
All these answers are right but lack the random variation asked in the question.
Suppose there exists a folder called Maps within ServerStorage and inside is each map grouped together in individual models.
local ServerStorage=game:GetService('ServerStorage') local maps=ServerStorage:WaitForChild('Maps') function cloneMap() local rng=Random.new():NextInteger(1,#maps) --#maps is the number of maps within the Maps folder, hence a random number is picked to determine the random map local mapClone=maps[rng]:Clone() mapClone.Parent=game.Workspace end
Closed as Non-Descriptive by JesseSong, moo1210, killerbrenden, namespace25, Xapelize, and Ziffixture
This question has been closed because its title or content does not adequately describe the problem you are trying to solve.
Please ensure that your question pertains to your actual problem, rather than your attempted solution. That is, you were trying to solve problem X, and you thought solution Y would work, but instead of asking about X when you ran into trouble, you asked about Y.
Why was this question closed?