Need help making a reoccurring round system with GUI leaderboard

Hi, Scripters!

I’m not even sure where to start with this problem so let me explain it. When there are 2 players in the server, a 20 second intermission will start before the round takes place. When the round takes place, it will grab all the people in the server and put them in a GUI leaderboard ranked by how much time they’ve spent on a specific part (Basically king of the hill). This GUI should make everyone start at zero (regardless of what their leader stats say) and choose a winner after 60 second (the person with the highest time).

HUGE thanks to anyone that can help. I will be waiting to see responses for questions, comments, or help with the topic. Here is the code I have so far (a script in ServerScriptService. Good luck and thanks again!

local GUI = game.StarterGui.Rounds.Timer
local Clock = 20
local Timer
function Round()
	while Clock > 0 do
		GUI.TextLabel.Text = "Starting round in ".. Clock.. " Seconds!"
		Clock -= 1
		wait(1)
	end
	Clock = 60
	GUI.Parent.PlayersInRound.Visible = true
	while Clock > 0 do
		--Help creating leaderboard
		Clock -= 1
		wait(1)
	end
	local Winner --Help finding winner
	GUI.TextLabel.Text = Winner.Name
	wait(3)
	GUI.Parent.PlayersInRound.Visible = false
end

while true do
	if #game.Players:GetChildren() < 2 then
		GUI.TextLabel.Text = "Waiting for 2 players to start next round!"
	elseif #game.Players:GetChildren() >= 2 then
		Round()
	end
	wait()
end

Here to provide you with any more information you need!

Any errors, or just code not working?

Well, what you probably wanna do is have some kind of table of players that are currently in the round and remove them from it as they get eliminated and then all you gotta do is get the remaining player in the table when the round ends (if there is one).

Edit: Ok nvm not sure how to do the GUI part, but fo the winner part you could probably do something like this I doubt it’s the most efficient, but if you can find a way to update the values of the players it should work.

local winner = nil
local dictionary = {
	["player1"] = 20, 
	["player2"] = 29, 
	["player3"] = 15, 
	--etc
}

for name,t in pairs(dictionary) do 
	if winner == nil then
		winner = name
	end
	
	if t > dictionary[winner] then
		winner = name
	end
end

The code just doesn’t function yet, I don’t know how to approach making the leaderboard