I need a script to load and end maps, can anyone make one for me?
Load and End maps?
1 answer
You commenters are soooooooooooooooooooooo mean :((((((((
Anyways...
First, assuming you want to clone everything in workspace, that is exactly what we'll do.
The clone function allows you to clone an existing instance, although it has no default parent.
So how exactly do we clone everything in workspace?
Simply get the children of workspace using GetChildren in a for loop.
For example, this script will print all the names of the objects in workspace:
for i,v in pairs(game.Workspace:GetChildren())do -- Grabs all the children inside workspace
print(v.Name) -- Prints the name. As you can see we used 'v' as it's already stated.
end
Now, if you want to CLONE everything in workspace, it's similar. The only problem is that you have to REMEMBER THAT IT HAS NO DEFAULT PARENT. That can be easily fixed by just parenting it in the code.
To clone everything in workspace, just do this:
for i,v in pairs(game.Workspace:GetChildren())do
cloneditem = v:Clone()
cloneditem.Parent = game.Workspace
end
PLEASE UPVOTE AND ACCEPT MY ANSWER! THANKS!
This discussion is preserved as it was. New answers, comments, and votes are closed.

2 comments
not a request site, advertise yourself on forums
Your question is so vague that I don't even know where to start