Scoreboard updating errors

I am trying to have my scoreboard update on playerchange instead of every 2.5 seconds. The code I have is giving errors.



function self.ScrlPan:Refresh()

self:Clear(true)
table.Empty(self.players)

--snipped player panel stuff

end

function self.ScrlPan:Think()
	for _, panel in pairs(self:GetItems()) do
		if not IsValid(panel:GetTable().player) or #self.Players ~= #player.GetAll() then
		self:Refresh()
		end
	end
end


Error I’m getting is that self:GetItems() is nil. It might be because I had the think above the refresh so I moved it but it’s untested.

uhm eventually self.ScrlPan:GetItems() ?

Tried that, gave me a different error saying that self.ScrlPan was undefined also.

[editline]15th September 2014[/editline]

Fixed, thanks to long dicussions and argumentst with people, I converted over to PanelList