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