local players = game:GetService('Players')
TextButton = script.Parent.TextButton
Difference = 0
function UpdateList()
for _,Button in pairs(script.Parent:WaitForChild("Frame"):GetChildren())
do
Difference = 0
Button:Destroy()
end
-- Clear all Names.
for _,plr in ipairs(players:GetPlayers()) do
local Clone = TextButton:Clone()
Clone.Position = UDim2.new({0.018, 0},{0.036+Difference, 0})
Clone.Visible = true
Difference = Difference + 0.1
Clone.Text = plr.Name
end
end
players.PlayerAdded:Connect(UpdateList)
players.PlayerRemoving:Connect(UpdateList)
Well, the code above doesn't work as intended, and I tried for soooo long to get this to work. I tried doing it on the client, the server, but nothing worked. I wish I could just get this one problem out of the way, so I can finally work on my game efficiently.
If you know what to do/have done this before I would be very thankful if you helped me. I don't think a normal answer will suffice, as new problems keep arising. Therefore, it would be very nice if you could communicate with me and help me solve this issue.

5 comments
One question: Do you put the Frames inside the ListUI or inside the object that is the parent of the ListUI?
Ok nvm i figured it out myself
The parent.
I can't thank you enough!
I'm so happy I could help you!