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

Should I clone a part instance to create a new ore or should I create a new ore each time I need to?

I have a bunch of droppers that I need to loop through and have them drop ores. I was thinking: is it more efficient to :Clone() an already created part like this:

local oreToClone = Instance.new("Part")
local ore = oreToClone:Clone()

or should I just create a new instance per ore like so:

local ore = Instance.new("Part")

I hope you can help. Thanks!

1 comment

0

If you want to start from scratch I'd create a new instance

1 answer

✓ Accepted answer

If the part you want to create or clone every time the dropper activates has alot of changed variables such as brickcolor, size and name then i suggest using Clone to limit the amount of lines because using Instance.new("Part") creates a new part with default parameters (2x4x1 dimensions) except if you use more code lines to change the parameters:

local part = Instance.new("Part")
part.size = Vector3.new(1, 1, 1)
part.brickcolor = brickcolor.new("Bright red")

But its really up to you.

2 comments

0

lel very simple question. (also you can later change material position etc.)

0

sometimes simple questions require complicated answers

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