For example, say I want to clone a specific part several times in a script. What would be more efficient, to define it all as a variable at the beginning of the script or to actually create the part and place it inside the script?
Defined Part Example:
local Part = Instance.new("Part")
Part.CanCollide = false
Part.Size = Vector3.new(2,2,2)
Part.Transparency = 1
script.Parent.Touched:connect(function()
local newpart = Part:clone()
newpart.Parent = workspace
end)
Pre-Made Part Example:
local Part = script:FindFirstChild("Part")
script.Parent.Touched:connect(function()
local newpart = Part:clone()
newpart.Parent = workspace
end)
I find it confusing because with the defined version, the part doesn't have to physically exist inside the script yet, whereas it does with the pre-made example. Which one would be better to use?

1 comment
It doesn't matter. Efficiency is negligable, and your assumption on the hierarchy requirement is wrong.