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

Is there an alternative to :Clone()?

This is just a random question that if there is an alternative option to the :Clone()

1 comment

0

lolwut

3 answers

You could do

local part = Instance.new("Part") -- or whatever

then make all of it's properties equal to the other part.

3 comments

0

What I'm cloning has so many objects it's not simple to do it for every single one.

0

local part ================================= Instance.new

0

Fixed.

A possible alternative would be Instance.new(), but Instance.new() does not create an identical copy of a part unless you specifically set the new part's properties so that every property has a value identical to the original part. Clone() simply creates a copy of the Instance the method was called from. The clone of the Instance shares its properties with the original Instance (the properties on both Instances are exactly the same in name and set value). A lot more work is required with Instance.new() if you ever think to using it in place of Clone() (although doing so is fool's gold).

If your using a model then you can do this.

local Model = workspace.Model -- You might want to change this.

for i,Parts in pairs(Model:GetChildren()) do -- You might also want to change this.
	Parts:Clone()
	Parts.Parent = workspace -- You might also want to change this too.
end

2 comments

0

This could also give some ideas

0

He said an ALTERNATIVE to it, not another way to USE it.

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