elseif i == 0 then
Status.Value = "The winner is "..plrs[1].Name
break
How do i make the results show all the names of players still alive at the end of the round?
2 answers
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
2 comments
Do you know how to display player1,player2,player,3 has won?
Make a table from the for loop lol
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
- You can add BoolValue to player when he join using this code (From Server)
game.PlayerAdded:Connect(function(plr) Value = Instance.new("BoolValue") Value.Parent = plr Value.Name = "Alive" end)
- for checking Players (from Client)
for i,v in pairs(game.Players:GetPlayers()) do if v.Alive.Value == true then
--implement your leaderboard system here end end
This discussion is preserved as it was. New answers, comments, and votes are closed.

1 comment
Create a for loop iterating through every player in game. For each player, make a player.Character.Humanoid.Died event listener. When a player dies, add their name to a table. At the end of the round, run a for loop through that table and every player in game. For every player not in the losers' table, add their name to a winners' table, then show each winner through another for loop.