elseif i == 0 then
Status.Value = "The winner is "..plrs[1].Name
break
Depending on how you sort your groups of players, you can use Players:GetChildren()
(or Players:GetPlayers()
if you want) to get a table or list of all players in one server. Then you can use a for loop and an if statement to check if they are alive or not.
for _,v in pairs(game:GetService("Players"):GetChildren())do if true then -- Condition to seperate the players -- Code to execute end end
you can add BoolValue to player when he join using PlayerAdded and change it to true when round start and to false when he died
game.PlayerAdded:Connect(function(plr) Value = Instance.new("BoolValue") Value.Parent = plr Value.Name = "Alive" end)
for i,v in pairs(game.Players:GetPlayers()) do if v.Alive.Value == true then
--implement your leaderboard system here end end