Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Game Map Loader?

Asked by 8 years ago

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

2 answers

Log in to vote
1
Answered by
nobo404 17
8 years ago

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.

0
Remove the () on game.Workspace! Shawnyg 4330 — 8y
0
Thanks! I can easily get confused between objects and functions! nobo404 17 — 8y
Ad
Log in to vote
-1
Answered by 8 years ago
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 :)

Answer this question