Starting block starting immediately instead of waiting for enough players to stand on it

It’s supposed to just update the billboard GUI until enough players for a game are standing on the block, but instead, as soon as 1 person touches the block the game starts. I looked myself and it stops somewhere around “print(“7”)”

the output box was

1wagwan
7

clip:

local repstorage = game:GetService("ReplicatedStorage")

local gameplate = repstorage.ShockwaveBaseplate

local startblock = game.Workspace:FindFirstChild("StartingBlock")

local killzone = repstorage.KillZone

local tele1 = workspace.Teleporters.Tele1

local tele2 = workspace.Teleporters.Tele2

local tele3 = workspace.Teleporters.Tele3

local tele4 = workspace.Teleporters.Tele4

local numOfPlayersGUI = workspace.StartingBlock.BillboardGui.TextLabel

local voted = game:GetService("ReplicatedStorage").Voted

local deb = false

local Teleporters = {
	workspace.Teleporters.Tele1,
	workspace.Teleporters.Tele2,
	workspace.Teleporters.Tele3
}

local list = {
	
}

workspace:WaitForChild("StartingBlock").Touched:Connect(function(touched)
	
	if touched.Parent:FindFirstChildOfClass("Humanoid") and deb == false then
		
		if touched.Parent:FindFirstChild("Voted") then return end
		
		deb = true
		
		
		local player = touched.Parent
		
		local hasVoted = voted:Clone()
		
		hasVoted.Parent = player

		table.insert(list, game.Players:GetPlayerFromCharacter(touched.Parent))

		deb = false
		


	end
	while #list <= 4 do
		
		wait(0.5)
		
		workspace.StartingBlock.BillboardGui.TextLabel.Text = #list.."/8 Players"
		
		print(#list.."wagwan")
		
	
print("7")

	if #list <= 4 then
		 repeat wait() until #list == 4
			print(#list.."ok2")
			startblock.Touched:Connect(function(touched, player)
				print(#list.."ok")
	for i,v in pairs(game.Players:GetChildren())do
					print(#list.."ok3")
		gameplate.Parent = workspace
		
		killzone.Parent =  workspace
		
		gameplate.Position = Vector3.new(0,500,0)
		
		killzone.Position = gameplate.Position - Vector3.new(0,10,0)
		
		tele1.Position = gameplate.Position + Vector3.new(50,2,50)
		
		tele2.Position = gameplate.Position + Vector3.new(-50,2,-50)
		
		tele3.Position = gameplate.Position + Vector3.new(-50,2,50)
		
		tele4.Position = gameplate.Position + Vector3.new(50,2,-50)
		
		local HRP = v.Character:WaitForChild("HumanoidRootPart")
		
		local n = math.random(1, #Teleporters) 

		HRP.CFrame = Teleporters[n].CFrame
		
	end
	end)
end
	

Be aware that Touched isn’t just called once for each player. It will be called multiple times based on animations, walk cycles etc.

I have a debounce for that already

You do not. There is no TouchEnded, or checking that the player hasn’t already stepped on the plate. You have a ‘debounce’ that isn’t even doing anything. It’s getting immediately set to false as soon as it’s set to true.

Would this not prevent it from repeating on the same player

		if touched.Parent:FindFirstChild("Voted") then return end
		
		
		local player = touched.Parent
		
		local hasVoted = voted:Clone()
		
		hasVoted.Parent = player

Didn’t see that one, sorry.
Your actual teleportation code is completely ignoring the debounce though
image

Yeah it keeps stopping after the first section of code, but it still teleports the players not sure how or why