I made a script to get player names when they enter the game. Its not working but I wanted to make it more efficient but Im stuck. Original 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)
New script : I was trying to make this script put the player's name inside a txt button and also the names would be evenly spaced.
local Player3 = script.Parent.Base:clone()
Player3.Position = Player3.Position + UDim2.new(0,0,0,Players2*29)
Player3.Visible = true
Player3.Parent = script.Parent
Player3.Name = "Player"
Player3.Text = v.Name

1 comment
btw the script is referring to base inside the frame. I tried editing it and its still not working.