I made a script that isnt working but after editing several times, i am on the verge of giving up. This is the script. Its supposed to get a player's name inside a text label. script family tree = startergui.maingui.menubutton.lobby.player1.Name.script
local lobby = game.StarterGui.MainGui.MenuButton.Lobby
game.Players.PlayerAdded:connect(function(player)
local ch = game.Players:GetPlayers()
for i = 1, #ch do
lobby["Player" .. i].Text = ch[i].Name
end
for i = #ch + 1, 16 do --clear the unused TextLabels
lobby["Player" .. i].Text = ""
end
end)

2 comments
Don't give up. I'll fix your code as soon as I can test in studio
While this is a duplicate I will attempt to answer