I'm making a simple script in which when a ClickDetector is activated it will loop through all of the players in the game at the current time and paste them onto a GUI TextButton. However, it only is printing the first name on the list which when testing on studio is simply just 'Player1'. How would I make it so the names are listed in a row, such as: 'Player 1 Player 2 Player 3'. I have done this previously but can't recall how I did it. Here is the code that I have got so far:
local player = game.Players
game.Workspace.Bowl.ClickDetector.MouseClick:Connect(function()
for i,v in pairs(player:GetChildren()) do
script.Parent.playerList.Text = v.Name
end
end)

1 comment
Alright, got it.