local function repeatPart(part: BasePart, count: number, distance: number): ()
for i = 1, count do
local clone = part:Clone()
clone.CFrame = part.CFrame + part.CFrame.LookVector * (i * distance)
clone.Parent = part.Parent -- What if the part is not directly in workspace?
end
end
You can also use UpVector and RightVector (as well as reverse those vectors for the opposite direction) to clone parts in different directions.
I’ve already tried this but you cannot multiply CFrame values by Vector Values. Thank you though. Unable to assign property CFrame. CoordinateFrame expected, got Vector3
That’s because CFrame * Vector3 returns a Vector3. Part.CFrame expects a CFrame, but you provided a Vector3 instead. If you want it to return a CFrame, you can multiply the CFrame by another CFrame:
local newCFrame = Part.CFrame * CFrame.new(5, 0, 0)