--//Variables
local ReplicatedStorage = game.ReplicatedStorage
local ServerStorage = game.ServerStorage
local Status = ReplicatedStorage.Values.Status
local SecondaryStatus = ReplicatedStorage.Values.StatusNoLabel

local Players_To_Start = 2
local contestants = {}
local WaitingPlayers = {}
local PlayersInRound = {}

--//Functions

game.Players.PlayerAdded:Connect(function(player)
	 GetPlayerAmount = #game.Players:GetPlayers()
	table.insert(WaitingPlayers,player.Name)
end)

while wait(1) do
	
	for ServerStartUpTime = 35,0,-1 do
		Status.Value = "Server Starting up. The main things will be intialized in "..ServerStartUpTime
		wait(1)
	end
	
	repeat
		print("Waiting")
		SecondaryStatus.Value = "Waiting"
		Status.Value = "("..GetPlayerAmount.."/"..Players_To_Start..")"
		wait()
	until GetPlayerAmount  >= Players_To_Start
	
	
	for start = 10,0,-1 do
		print(start)
		Status.Value = "Game starting in "..start
		SecondaryStatus.Value = "Intermission"
		wait(1)
	end
	
	for i,v in pairs(WaitingPlayers) do
		table.insert(contestants,i,v)
		table.remove(WaitingPlayers,i)
		warn(i.."="..v)
	end
	

When 2 player join the game, it only inserts 1 player into that table.

5 comments

0

maybe try running the while wait() do loop in a seperate thread?

0

Can you show which line it is on?

0

In Line 14-17 it should insert the player

0

You inserted player's name

0

Well. The main problem is. That it only inserts 1 player into the table instead of 2