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

How do I perform efficient cloning?

local	Carbon = Instance.new("Part")
		Carbon.Anchored = false
		Carbon.CanCollide = false		
		Carbon.Size = Vector3.new(1.5, 1.5, 1.5)
		Carbon.BrickColor = BrickColor.new("Black")
		Carbon.Parent = Player.Character

local 	Carbon2 = Carbon:Clone()
local 	Carbon3 = Carbon:Clone()
local 	Carbon4 = Carbon:Clone()
local 	Carbon5 = Carbon:Clone()
local 	Carbon6 = Carbon:Clone()
local 	Carbon7 = Carbon:Clone()
local 	Carbon8 = Carbon:Clone()
local 	Carbon9 = Carbon:Clone()
local 	Carbon10 = Carbon:Clone()

I really want a faster way to make multiple clones without having to copy and paste clones all the time.

1 answer

✓ Accepted answer

You would use a "for" loop, which would do it as many times as you want. Example:

for i = 1,10 do
	-- Code
end

Would play the same function 10 times. ( i would be the "repetition ammount")

So in your case you would replace " -- code " with a "Carbone:Clone()"

If you want to save each clone as a value, you would use a table. I'll let you read this http://wiki.roblox.com/index.php?title=Table

( You can insert models in a table)

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