Help with scoreboard

I need help with how to make a scoreboard I don’t need the link to the default one because I’ve already took it apart, I understand how most of works. I need help with Drawing a row per player and have no idea how to? It would help if someone could post a small example of one and explain bits? Thanks a lot

Use a DIconLayout and add DPanels to it

DScrollPanel, for k,v in pairs, DPanels, SetPos(0,(heightandspacing*k)-height)

I just don’t know how to add a panel per player. So when the player joins it adds them to a scoreboard on a panel? Pretty much per player

So when a player joins it adds them to a row

Playerlist:AddItem(PlayerCard)

something like that.

got no computer so i cant check my scoreboards…

Everything I said before is technically all you need, the k,v in pairs is for the players

Example from my scoreboard:



--some timer here for update
self.ScrlPan:Clear() --clears scroll panel on update
for k,ply in pairs(player.GetAll()) do --for every player create a panel
	self.UserBar = vgui.Create("DPanel",self.ScrlPan)
	self.UserBar:SetPos(0,(37*k)-32)
	self.UserBar:SetSize(self.ScrlPan:GetWide()-20,32)
	self.UserBar:SetBackgroundColor(fsb_ubar_bg)

	self.UserBar.UName = vgui.Create("DLabel",self.UserBar)
	self.UserBar.UName:SetPos(33,1)
	self.UserBar.UName:SetText(Name(ply,data))
	self.UserBar.UName:SetColor(color_white)
	self.UserBar.UName:SetFont("FScoreboardLabel")
	self.UserBar.UName:SizeToContents()
end


Here’s a link to the base game-mode scoreboard: https://github.com/garrynewman/garrysmod/blob/master/garrysmod/gamemodes/base/gamemode/cl_scoreboard.lua