I've made this loop to add some basePart positions together so that I can get these chairs equally spaced from each-other no matter how many chairs there are. The only problem is, the first clone seems to have double the amount of space than the rest (about 10 studs, when it should be 5). I'll show a picture and the code. It's probably something really simple that I'm overlooking.
for i = 1, AmountOfChairs do --AmountOfChairs = 6 if not workspace:FindFirstChild("firstChair") then --Only fires when theres no chair yet firstChair = servStorage:WaitForChild("Chair"):Clone() firstChair:SetPrimaryPartCFrame(CFrame.new(0, 1.5, 0)) firstChair.Name = "firstChair" firstChair.Parent = workspace firstChairPos = firstChair.PrimaryPart.Position --Saving the original position for later use end local newChair = firstChair:Clone() if not workspace:FindFirstChild("clonedChair") then --if theres not a clone then do this newChairPos = firstChairPos + Vector3.new(5, 0, 0) end newChairPos = newChairPos + Vector3.new(5, 0, 0) --add to itself + 5 on xVal newChair:SetPrimaryPartCFrame(CFrame.new(newChairPos)) newChair.Name = "clonedChair" --the chair in the second if-statement newChair.Parent = workspace end
Also feel free to help me out with the weird if-statements, after all, it may the root of my problem.
Edit: New site format doesn't allow for pictures to be added yet, Rip. This is way easier to read with some visual feedback.
https://cdn.discordapp.com/attachments/470922111746310154/584757796570923034/Screen_Shot_2019-06-02_at_9.31.56_AM.png