Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

Game Map Loader?

Any help with a system that will load a map from server storage to workspace? Or would that be A clone function?

2 answers

It would be a :Clone() function doing most of the work. Here is a simple script that would work, if it happens your map is named "MapNameHere" :)

map = game.ServerStorage.MapNameHere:Clone() -- Replace MapNameHere with the name of the map
map.Parent = game.Workspace

Here's how it works:

  1. First we Clone() the map from ServerStorage and set it in the variable "map"
  2. Now we set the "map" variable's Parent to Workspace, copying the entire model to the 3D view

All you would need to do after this code is to surround it with other code such as loops and other functions. If you need two different maps, you can use a random number generator with copies of this code.

2 comments

0

Remove the () on game.Workspace!

0

Thanks! I can easily get confused between objects and functions!

while true do
--first Map
wait(1)
local MP1 = game.ServerStorage.MP1
MP1:Clone().Parent = game.Workspace	 --clones the first map into workspace
wait(10)
game.Workspace.MP1:Destroy() --deletes that map
end

Hope it works :)

This discussion is preserved as it was. New answers, comments, and votes are closed.