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)
Your question isn't quite clear enough but I'm guessing you're trying to add a players name to ALL of the player's GUI and accessing game.StarterGui
won't do that you will have to use
for i,v in pairs (game.Players:GetChildren()) if v.Name == StaterGui then --continue from here and don't forget to add end in the right spot
I'm also assuming that you want this to happen to each player when they new player enters, as your script works, it will only show it to the player once they die. I also noticed that the player is identified, but never used, so nothing will ever happen with his name. While I don't know how to answer this question at the moment, Those are some things to take into consideration. I would have posted this as a comment but I think there's a limit on characters.