Okay, if you don't know what my what my question even mean here is a photo of a gui I made to make a leaderboard gui.
Picture 1: https://gyazo.com/5153ea98d187e982e0799afaf39a450e
Okay, in this picture trying to make a gui Leaderboard.
I made this script here that it finds the username.
local player = game.Players.LocalPlayer local unitFrame = script.Parent unitFrame:WaitForChild("PlayerName").Text = player.Name
Here is what it does.
Picture 2: https://gyazo.com/931c47964f8224feaad2f44e3633fb49
But somehow I wanna have it where it clones the name when a new player joins it has their name.
It's like the same thing as the ROBLOX Leaderboard.
So, how do I make it where it makes it just when a new player joins it clones like the same thing as the name. at the top like this picture here.
https://gyazo.com/931c47964f8224feaad2f44e3633fb49
I see you're using a "localscript" but what you want is a "script" that affects all players. And are you asking for something like a table to store every player's name?
local myTable = {} local function MakeTextBox(playerName) --spawn a textbox with the player's name and set coordinates accordingly end game.Players.PlayerAdded:Connect(function(Player) myTable[Player.UserId] = Player.Name MakeTextBox(Player.Name) end) local function PrintEverbodysName() for _,player in pairs(myTable) do print(player) end end while wait(1) do PrintEverbodysName() end
Or are you asking to programmatically create textboxes and position them? In your equation you'll want a variable for spacings, paddings, size of textboxes, size of frame etc...
Well, you could do a (very) little but of adding, like this:
game.Players.PlayerAdded:connect(function(p) textbox = TEXTBOX g = textbox:Clone() g1 = #textbox.Parent:GetChildren() g.Parent = textbox.Parent g.Position = UDim2.new(0,g.Position.X.Offset,0,g.Position.Y.Offset*g1) g.Text = p.Name end)
Wrote this in about a minute, forgive me if I made a mistake.