I'm not sure if I have any errors in this as I can't access studio right now, so I'm simply asking if someone could proof read it. The end goal for this script is to wait for the round to end, and when it does I want it to change the string value (Status) to the winners. The problem that I had to work around is that I want it to say "and x" when the last player name is being displayed, but I didn't want it to say and in between every player (example: a and b and c).
What I want it to look like is this: "The winners are: player 1, player 2, player 3, and player 4
--// Variables \\--
Status = game.ServerStorage.Status
--// Main Script \\--
game.ReplicatedStorage.RoundEnding.OnServerEvent:Connect(function(Reason)
if Reason == “RunnersWon” then
for i, player in pairs(game.Players:GetPlayers()) do
wait(1.5)
if player.Dead.Value ~= true and player.Role.Value ~= nil then
player.leaderstats.Points.Value = player.leaderstats.Points.Value+15
if i == 1 then
Status.Value = “The winners are: “ player.Name.. “,”
elseif i == NumPlayers then
Status.Value = Status.Value.. “ and ”.. player.Name
else
Status.Value = Status.Value.. player.Name.. “,”
end
end
end
end
end)

2 comments
He hasn't checked it in a while, but this sure is helpful for me too. Currently trying to learn the basics of table.concat().
Thanks, my way did work but this script is definitely cleaner