No 1 has appeared

You can write your topic however you want, but you need to answer these questions:

  1. What do you want to achieve? Keep it simple and clear!
    a list with all the players

  2. What is the issue? Include screenshots / videos if possible!
    i dont see any 1

  3. What solutions have you tried so far? Did you look for solutions on the Developer Hub?
    no

After that, you should include more details if you have any. Try to make your topic as descriptive as possible, so that it’s easier for people to help you!

-- local script
local Add = function(player)
	wait(2)
	
	local scr = script.Parent
	for i,v in ipairs(scr:GetChildren()) do
		if v:IsA("TextButton") then
			v:Destroy()
		end
	end
	wait()
	for i,v in ipairs(game.Players:GetPlayers()) do
		print('hello '..player.Name)
		local TextButton = Instance.new("TextButton")
		local Name = v.Name
		local disP = v.DisplayName
		TextButton.Name = Name
		TextButton.Text = disP..',['..Name..']'
		TextButton.Size = UDim2.new(0.95, 0,0.1, 0)
		TextButton.Parent = scr
	end
	
end
game.Players.PlayerAdded:Connect(Add)
game.Players.PlayerRemoving:Connect(Add)
	

I think your problem is: PlayerAdded doesn’t fire in your script since it already fired but the script haven’t load and it made a connection after the event fired (This will only happen in local scripts).

So the playerlist will be empty until someone else joins.

The solution could be getting all the players when the script starts running. An example:

local Players = game:GetService("Players")
local Playerlist = Players:GetPlayers() 
-- Now connect the event and do your list with the table playerlist

lol sorry but this is golden right here