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

How to ungroup a Map from ServerStorage?

Ok so I have this game, and it picks a random map from SerevrStorage, then puts it in a Model called "MapHolder" in Workspace. I need i once its put in the MapHolder, to ungroup the map. Is there part of code that can do it, like :unGroup() ??

	if game.Players.NumPlayers > 1 then
		h.Text = "Deciding what map to play"
		wait(5)
		ranMap = math.random(1, #map)
		mapChosen = map[ranMap]
		h.Text = "Map Chosen: " .. mapChosen.Name
		wait(3)
		mapChosenClone = mapChosen:Clone()
		mapChosenClone.Parent = game.Workspace.MapHolder
		wait(2)

This picks a random map. What i need is when the map goes to MapHolder, it ungroups itself. I would post the whole script, but the script is like 100 lines long. Anyone help??

2 answers

✓ Accepted answer

Make the (children of the map's) parent to the MapHolder, then delete the map model.

for i,v in pairs(mapChosenClone:GetChildren()) do
v.Parent = mapChosenClone.Parent
wait()
mapChosenClone:Destroy()
end

3 comments

0

so this will put the map in MapHolder and Ungroup at the same time?

0

That dosent answer my question

0

Then what exactly are you asking here.? I've edited the script with your variables, just put that after wait(2).. that ungroups the chosen map's clone, moving all the children into the MapHolder, then deleting the empty model.

Why not just put it all in workspace instead of adding it to the model then ungrouping it?

1 comment

0

Cause then all the maps and stuff have to load at once, even if it's not being used at the time.

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