How I can make stages connect perfectly?

Ok now I’m getting no error in output and this is happening:

Here’s the fixed code I made:

for i = 1,8 do
	
	stages['Stage'..i] = Stages[math.random(1, #Stages)]:Clone()
	Floor = stages['Stage'..i]
	local Height = Floor:WaitForChild("Height")
	stages['Stage'..i].PrimaryPart = Floor:FindFirstChild("Center")
	
	local CurrentLevelNm = i -- Ignore me :D
	
	if CurrentLevelNm == 1 then
		
		stages['Stage'..i]:SetPrimaryPartCFrame(stages['Stage'..i - 0].Center.CFrame + Vector3.new(0, stages['Stage'..i]:WaitForChild("Height").Value, 0))

		stages['Stage'..i]:SetPrimaryPartCFrame(Floor.Center.CFrame * CFrame.Angles(X, Y, Z))
		
	else
		
		stages['Stage'..i]:SetPrimaryPartCFrame(stages['Stage'..i - 0].Center.CFrame + Vector3.new(0, stages['Stage'..i - 1]:WaitForChild("Height").Value, 0))

		stages['Stage'..i - 1]:SetPrimaryPartCFrame(Floor.Center.CFrame * CFrame.Angles(X, Y, Z))

		
	end
	
	stages['Stage'..i].Parent = Tower
	
end
1 Like

I’ll check this tomorrow 'cuz my mom told me to go sleep

Maybe try cleaning it up some more.

Instead of stages['Stage'..i], you could use Floor after the Floor variable is declared. Also, you should store the Height variable outside of the loop, it’s only being changed for that current iteration.

local Height = 0

for i = 1,8 do
    -- now change the height variable using Height = Floor:WaitForChild('Height').Value, this will change the variable outside of the loop, and make it accessible for the other iterations.

I’m off to bed as well, I will check back here tomorrow!

1 Like

What did was make a Part Called Center and get the height of each Center of each Stages and for spawning the next stage increase it’s Center’s CFrame by the Height of the Previous stage’s Center.

i would recommend to stay away from f3x, turns out it has backdoors

1 Like

I guess you’re in luck, AlvinBlox is about to start streaming him making a tower of hell type game:

1 Like

I didn’t checked AlvinBlox for a while, thanks for your reply! :slightly_smiling_face:

1 Like