Problem with script!

Does anyone see a problem in this script? because I don’t
heres the workspace
Schermopname (18)

and the script:

	repeat
		local newAmountRows = #platesFolder:GetChildren()
		
		local rowToClone = platesFolder:FindFirstChild("Row"..tostring(newAmountRows))
		
		local rowClone = rowToClone:Clone()
		rowToClone.Name = "Row"..newAmountRows + 1
		rowToClone.Parent = platesFolder
		
		print("Aplied Settings")
		
		for i,v in pairs(rowClone:GetChildren()) do
			if v.Name == "Row" then
				v.Value += 1
			elseif v.Name == "Plate" then
				local currentPlate = v
				local currentLine = v.Line.Value
				local thisRow = v.Parent.Row.Value
				local colorRowToSearch = thisRow - 2
				local otherColorModel = platesFolder:FindFirstChild("Row"..tostring(colorRowToSearch))
				
				local positionRowToSearch = thisRow - 1

				local otherPositionModel = platesFolder:FindFirstChild("Row"..tostring(positionRowToSearch))
				
				for i,v in pairs(otherPositionModel:GetChildren()) do
					if v.Name == "Plate" then
						for i,v in pairs(v:GetChildren()) do
							if v.Name == "Line" then
								if v.Value == currentLine then
									local otherPositionPart = v.Parent

									local newPositionX = otherPositionPart.Position.X + 9
									local newPositionY = otherPositionPart.Position.Y
									local newPositionZ = otherPositionPart.Position.Z
									currentPlate.CFrame = CFrame.new(newPositionX, newPositionY, newPositionZ)
								end
							end
						end
					end
				end
				-- check form here
				for i,v in pairs(v:GetChildren()) do
					if v.Name == "Line" then	
						for i,v in pairs(otherColorModel:GetChildren()) do
							if v.Name == "Plate" then
								for i,v in pairs(v:GetChildren()) do
									if v.Name == "Line" then
										if v.Value == currentLine then
											local otherColorPart = v.Parent
											currentPlate.Color = otherColorPart.Color
										end
									end
								end
							end
						end
					end
				end
			end
		end
		wait(0.5)
	until #platesFolder:GetChildren() == finalRowsAmount
1 Like

Can you actually explain what is wrong and mark the line(s) that are broken?

1 Like

bro I already said I don’t know btw this is one part of one huge script and in this part is the problem I’m still trying to figure out where ill reply when I found it

1 Like

Is there a specific part that stops, does the whole loop run, or does none of the loop run? Nothing looks wrong, but I need more information than “idk what’s wrong, here is a script.”

I just need to know if there’s a specific for loop not running, or if the whole repeat loop is broken so I know where to look exactly since nothing appears to be wrong.

1 Like

thats the problem I tried printing , it prints everyting it goes treu the whole repeat but nothing happends I can send trhe whole script if you want!

this is the whole script

local platesFolder = game.Workspace:WaitForChild("PlatesFolder")
local foundColor = Color3.new(0.0588235, 0.921569, 0.0431373)
local timer = game:WaitForChild("ReplicatedStorage"):WaitForChild("Timer")
local teleportPart = game.Workspace:WaitForChild("GameFolder"):WaitForChild("TeleportPart")
local lobbyPart = game.Workspace:WaitForChild("GameFolder"):WaitForChild("LobbyPart")
wait(60)
while true do

	repeat
		timer.Value = "Waiting for enough players."
		task.wait(1)
		timer.Value = "Waiting for enough players.."
		task.wait(1)
		timer.Value = "Waiting for enough players..."
		task.wait(1)
	until game.Players.NumPlayers >= 1
	
	timer.Value = "Enough players are in the game!"
	task.wait(1)
	
	timer.Value = "Loading game."
	wait(1)
	
	-- creating new rows
	
	local playerAmount = #game:GetService("Players"):GetPlayers()

	local calculationRowsAmount = playerAmount / 1.7

	local calculatingRowsAmount = playerAmount * 2

	local calculatorRowsAmount = calculatingRowsAmount - calculationRowsAmount

	local finalRowsAmount = math.ceil(calculatorRowsAmount)
	
	
	local amountRows = #platesFolder:GetChildren()
	
	print("Calculated")
	
	repeat
		local newAmountRows = #platesFolder:GetChildren()
		
		local rowToClone = platesFolder:FindFirstChild("Row"..tostring(newAmountRows))
		
		local rowClone = rowToClone:Clone()
		rowToClone.Name = "Row"..newAmountRows + 1
		rowToClone.Parent = platesFolder
		
		print("Aplied Settings")
		
		for i,v in pairs(rowClone:GetChildren()) do
			if v.Name == "Row" then
				v.Value += 1
			elseif v.Name == "Plate" then
				local currentPlate = v
				local currentLine = v.Line.Value
				local thisRow = v.Parent.Row.Value
				local colorRowToSearch = thisRow - 2
				local otherColorModel = platesFolder:FindFirstChild("Row"..tostring(colorRowToSearch))
				
				local positionRowToSearch = thisRow - 1

				local otherPositionModel = platesFolder:FindFirstChild("Row"..tostring(positionRowToSearch))
				
				print("Variables done")
				
				for i,v in pairs(otherPositionModel:GetChildren()) do
					if v.Name == "Plate" then
						for i,v in pairs(v:GetChildren()) do
							if v.Name == "Line" then
								if v.Value == currentLine then
									local otherPositionPart = v.Parent
									
									print("SS")

									local newPositionX = otherPositionPart.Position.X + 9
									local newPositionY = otherPositionPart.Position.Y
									local newPositionZ = otherPositionPart.Position.Z
									currentPlate.CFrame = CFrame.new(newPositionX, newPositionY, newPositionZ)
								end
							end
						end
					end
				end
				print("SasasaS")
				-- check form here
				for i,v in pairs(v:GetChildren()) do
					if v.Name == "Line" then	
						for i,v in pairs(otherColorModel:GetChildren()) do
							if v.Name == "Plate" then
								for i,v in pairs(v:GetChildren()) do
									if v.Name == "Line" then
										if v.Value == currentLine then
											local otherColorPart = v.Parent
											currentPlate.Color = otherColorPart.Color
										end
									end
								end
							end
						end
					end
				end
			end
		end
		print("SsadasS")
		wait(0.5)
	until #platesFolder:GetChildren() == finalRowsAmount
	
	print("Created Rows")
	
	-- making rows kill off off first row
	
	local beginPart = math.random(1,4)
	
	for i,v in pairs(platesFolder:GetChildren()) do
		if v.Name == "Row1" then
			for i,v in pairs(v:GetChildren()) do
				if v.Name == "Plate" then
					for i,v in pairs(v:GetChildren()) do
						if v.Name == "Line" then
							if v.Parent.Line.Value == beginPart then
								v.Parent.Kill.Value = false
							end
						end
					end
				end
			end
		end
	end
	
	timer.Value = "Loading game.."
	wait(1)
	
	-- calculating all rows kill off
	
	for i, v in pairs(workspace.PlatesFolder:GetChildren()) do
		for i, v in pairs(v:GetChildren()) do
			if v.Name == "Plate" then
				v.Touched:Connect(function(otherPart)
					if otherPart.Parent:FindFirstChild("Humanoid") then

						local humanoid = otherPart.Parent:FindFirstChild("Humanoid")

						if v.Kill.Value == false then

							if v.Parent.RowUsed.Value == false then

								if humanoid.Health == 100 then
									v.Color = foundColor

									v.Parent.RowUsed.Value = true

									local newRow = v.Parent.Row.Value + 1

									local row = platesFolder:FindFirstChild("Row"..tostring(newRow))

									local randomNumber = math.random(1,3)

									if randomNumber == 1 then
										local line = v.Line.Value
										print(v.Name)
										local lineToMakeSave = line - 1
										if lineToMakeSave < 1 then
											for i,v in pairs(row:GetChildren()) do
												if v.Name == "Plate" then
													if v.Line.Value == line then
														v.Kill.Value = false
													end
												end
											end
										else
											for i,v in pairs(row:GetChildren()) do
												if v.Name == "Plate" then
													if v.Line.Value == lineToMakeSave then
														v.Kill.Value = false
													end
												end
											end
										end

									elseif randomNumber == 2 then
										local line = v.Line.Value
										for i,v in pairs(row:GetChildren()) do
											if v.Name == "Plate" then
												if v.Line.Value == line then
													v.Kill.Value = false
												end
											end
										end

									elseif randomNumber == 3 then
										local line = v.Line.Value
										local lineToMakeSave = line + 1
										if lineToMakeSave > 4 then
											for i,v in pairs(row:GetChildren()) do
												if v.Name == "Plate" then
													if v.Line.Value == line then
														v.Kill.Value = false
													end
												end
											end
										else
											for i,v in pairs(row:GetChildren()) do
												if v.Name == "Plate" then
													if v.Line.Value == lineToMakeSave then
														v.Kill.Value = false
													end
												end
											end
										end
									end
								end
							end
						else
							humanoid.Health = 99
							local player = game:GetService("Players"):GetPlayerFromCharacter(otherPart.Parent)
							if player then
								local character = otherPart.Parent
								if character then
									local humanoidRootPart = character:FindFirstChild("HumanoidRootPart")
									if humanoidRootPart then
										humanoidRootPart.CFrame = game.Workspace.GameFolder.TeleportPart.CFrame
									end
								end
							end
						end
					end
				end)
			end
		end
	end
	
	timer.Value = "Loading game..."
	wait(1)

	timer.Value = "Intermission 10"
	wait(1)
	timer.Value = "Intermission 9"
	wait(1)
	timer.Value = "Intermission 8"
	wait(1)
	timer.Value = "Intermission 7"
	wait(1)
	timer.Value = "Intermission 6"
	wait(1)
	timer.Value = "Intermission 5"
	wait(1)
	timer.Value = "Intermission 4"
	wait(1)
	timer.Value = "Intermission 3"
	wait(1)
	timer.Value = "Intermission 2"
	wait(1)
	timer.Value = "Intermission 1"
	wait(1)
	timer.Value = "Teleporting players."
	wait(1)

	if game.Players.NumPlayers >= 1 then
		
		for _, player in pairs(game.Players:GetChildren()) do
			local char = player.Character
			if char then
				local humanoidRootPart = char:FindFirstChild("HumanoidRootPart")
				if humanoidRootPart then
					humanoidRootPart.CFrame = teleportPart.CFrame
				end
			end
		end

		timer.Value = "Teleporting players.."
		wait(1)
		timer.Value = "Teleporting players..."
		wait(1)

		-- begin game
		
		

		local stadardTimerInScript = 60
		local timerInScript = 60

		repeat
			timer.Value = timerInScript.." seconds left!"
			timerInScript -= 1
			wait(1)
		until timerInScript <= 0
		
		timerInScript = stadardTimerInScript

		for _, player in pairs(game.Players:GetChildren()) do
			local char = player.Character
			if char then
				local humanoidRootPart = char:FindFirstChild("HumanoidRootPart")
				if humanoidRootPart then
					humanoidRootPart.CFrame = lobbyPart.CFrame
				end
			end
		end

		for i,v in pairs(platesFolder:GetChildren()) do
			for i,v in pairs(v:GetChildren()) do
				if v.Name == "Plate" then
					v.Kill.Value = true
					v.Color = v.CurrentColor.Value
				elseif v.Name == "RowUsed" then
					v.Value = false
				end
			end
		end
	else
		for i,v in pairs(platesFolder:GetChildren()) do
			for i,v in pairs(v:GetChildren()) do
				if v.Name == "Plate" then
					v.Kill.Value = true
					v.Color = v.CurrentColor.Value
				end
			end
		end
		break
	end
end

Could you please tell us what type of script it is (client or server), what should happen, what doesn’t happen and what happens instead?

We have to know some details about the script, otherwise, we can’t help

its a server script check my newest post there you can see everything

I still can’t see what the script is supposed to do. Why do you need this script? Whats the purpose of it? What does it do?

its the whole game the intere script there are 4 part in 1 row one off them wont kill you then you go to the row

ok in the script you just gave, i want you to show the line where there is an error using comments, like

code code stuff that doesnt work --ERROR HERE
code code stuff that works

i also want you to show what each part of the script does in more detail
otherwise, we wont know how to help you

the error is att line were it clones the part I don’t know the other errors because after that the script stops so there it stop for some reason but after a few tiems it stop at the cloning

ok i saw your new post and ill see what i can do to help