I'm trying to make it so it tells the players name an i want it like this "Winners: UltraUnitMode, Guest666, ROBLOX" if you know what i mean, so far i can only do it one at a time so it goes like this "Winners: UltraUnitMode" waits a second "Winners: Guest666" so on, hence the wait. Also I'm not sure if tostring() is a good idea to make it do that? Idk so thats why im asking lol
function LookForWinner() local Players = game.Players:GetChildren() for i = 1, #Players do if Players[i]:FindFirstChild('leaderstats') then if Players[i].leaderstats.KOs.Value >= 25 then Message('Winners: '..Players[i].Name) -- Sends into the function and changes the text for everyone wait(1) end end end end
Since you're not dealing with a Table, you have to use string concatenation in a loop:
function LookForWinner() local winners = "" for _, player in ipairs(game.Players:GetChildren()) do if player:FindFirstChild('leaderstats') and player.leaderstats.KOs.Value >= 25 then winners = winners .. (#winners > 0 and ", " or "") .. player.Name end end Message('Winners: ' .. winners) wait(1) end