This is the script that I made, its supposed to clone an existing textbutton and then change the text to the players name, I also have a list UI layout that makes it into a list. But.... Its not working. Please help give me an answer, there's nothing in the output.
game.Players.PlayerAdded:Connect(function(player) local give = script.Parent.TextButton:Clone() give.Text = player.Name end)
Fun fact, I also didn't know until recently but local scripts run after the local player joins. This means the script will run AFTER the player joins, thus meaning PlayerAdded
won't fire for the local player.
Just simple remove the PlayerAdded
event, also use :GetService()
local player = game:GetService("Players").LocalPlayer local give = script.Parent.TextButton:Clone() give.Text = player.Name