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.

3 comments
https://cdn.discordapp.com/attachments/470922111746310154/584757796570923034/Screen_Shot_2019-06-02_at_9.31.56_AM.png
Have you tried defining the variable
newchairposoutside of the for loop, do this just by doinglocal newChairPos, that might fix it so you can remix the thing you had to do because otherwise it gave a nil value thingThe problem was because you can't add its Value to itself, if the actual variable had no value yet. So, I created an if-statement that gives it a new value before its added to itself, by checking if it existed yet or not. Hopefully that makes sense oof. The value added to newChairPos is just the
firstChairPos + vector3.new(5, 0, 0)