I need a script to load and end maps, can anyone make one for me?
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!
Closed as Not Constructive by M39a9am3R and ImageLabel
This question has been closed because it is not constructive to others or the asker. Most commonly, questions that are requests with no attempt from the asker to solve their problem will fall into this category.
Why was this question closed?