This is my first time making a player list, I did use the wiki for reference and it got me this far. However, I'm getting crumbled down with all of the logic and it's screwing me up. How would I clean this up? Am I even going in the correct direction in updating a player list?
The Player List Object and it's contents - http://prntscr.com/6xv9cg
The Playerlist Gui - http://prntscr.com/6xva5g
I'm trying to add a player tab to the player list when they join, by updating the Tab with Their Player name and level. And have it updated to all players. Similar to the ROBLOX Player list.
Could anyone help me clear out the unnecessary stuff and help fix it?
function makePlayerTab(Player,PLAYER_FOR_TAB,Level,Last)
local tab = game.ServerStorage.PlayerTab:Clone()
tab.Parent = Player.PlayerGui.PlayerList.Holder:WaitForChild("PlayerList") -- something like this
tab.PlayerName.Text = Player
tab.Level = Level
tab.Position = UDim2.new(0, 0,0.024, 0)
return tab and spawn(function() if Last ~= nil then pcall(function() tab.Position = Last.Position + UDim2.new(0, 0,0.139, 0) end) end end)
end
function update(player)
local Players = game.Players:GetChildren()
local last;
for i,v in next,Players do
last = makePlayerTab(p,v,1337,last)
end
end
game:GetService'Players'.PlayerAdded:connect(function(p)
p.CharacterAdded:connect(function(c)
update(p)
end)
end)

4 comments
Have you tried the Changed Event?
I haven't made it so it changes when they upgrade a level but I know I'll need to, what is wrong with the current script I have..?
If this is inside the PlayerGui, .PlayerAdded won't work. Try doing .ChildAdded().
PlayerRemoving is an event.