Attempt to index global "list" ( a nil value)


	local list = frame:GetParent().PlayerList;
	local x, y = list:GetPos();
	local w, h = list:GetSize();

[ERROR] gamemode/scoreboard/vgui_ucscoreboard.lua:20: attempt to index local ‘list’ (a nil value)

  1. PaintFrame - gamemode/scoreboard/vgui_ucscoreboard.lua:20
  2. unknown - gamemode/scoreboard/vgui_ucscoreboard.lua:47

Ive looked about and i have no clue what list is, can anyone give me a clue on what the problem is?

If you are posting a Lua error you’re getting - then POST THE FULL ERROR AND THE CODE. Make sure you are posting the FIRST error you’re getting - not the last error.

Error says ‘list’ is nil.

list is set here:
[lua]local list = frame:GetParent().PlayerList;[/lua]

Then maybe you should check that the parent of ‘frame’ has a ‘PlayerList’ value and that it is being set properly. That’s the kind of error that’s usually easy to debug if you take some time you look through your own code.

Unless it’s not really your own code.