Scoreboard help?

[ERROR] gamemodes/skeleton/gamemode/cl_scoreboard.lua:57: attempt to call method ‘Nick’ (a nil value)

  1. unknown - gamemodes/skeleton/gamemode/cl_scoreboard.lua:57

Just writes label. I dont understand it :O. It works fine then i play singleplayer but then i set it to multiplayer with 2 players it just fucks up. (I did not add a bot)


function GM:ScoreboardHide()
gui.EnableScreenClicker(false)
	bg:Close()
	greybox:Close()
	greybox2:Close()
end

local ply = LocalPlayer()
local backgroundcolor = Color(10,10,10,215)
local greyfirst = Color(8,8,8,255)
local greysecond = Color(24,24,24,255)
surface.CreateFont("Deathkill",{ font = "Aero Matics Display Regular", size = 21})
surface.CreateFont("Ping",{ font = "Aero Matics Display Regular", size = 24})
surface.CreateFont("Name",{ font = "Aero Matics Display Regular", size = 19})
surface.CreateFont("Steamid",{ font = "Aero Matics Display Regular", size = 16})


function GM:ScoreboardShow()
gui.EnableScreenClicker(false)
	    bg = vgui.Create("DFrame")
		bg:SetSize(625,475)
		bg:SetPos(ScrW()/2-300,ScrH()/2-250)
		bg:SetDraggable(false)
		bg:ShowCloseButton(false)
		bg:SetTitle("")
		bg:MakePopup()
		bg.Paint = function()
			draw.RoundedBox(0,0,0,bg:GetWide(),bg:GetTall(),backgroundcolor)
		end
		
		greybox = vgui.Create("DFrame")
		greybox:SetSize(625,15)
		greybox:SetPos(ScrW() - 876,ScrH() - 692)
		greybox:SetDraggable(false)
		greybox:ShowCloseButton(false)
		greybox:SetTitle("")
		greybox:MakePopup()
		greybox.Paint = function()
			draw.RoundedBox(0,0,0,ScrW() - 25,ScrH() - 25, greyfirst)
		end
		
		greybox2 = vgui.Create("DFrame")
		greybox2:SetSize(625,15)
		greybox2:SetPos(ScrW() - 876,ScrH() - 707)
		greybox2:SetDraggable(false)
		greybox2:ShowCloseButton(false)
		greybox2:SetTitle("")
		greybox2:MakePopup()
		greybox2.Paint = function()
			draw.RoundedBox(0,0,0,ScrW() - 25,ScrH() - 25, greysecond)
		end

		local name = vgui.Create("DLabel",bg)
		name:SetPos(50,10)
		name:SetSize(200,30)
		name:SetFont("Name")
		name:SetText(ply:Nick())
		name:SetTextColor(Color(230,230,230))
		
		local avatar = vgui.Create("AvatarImage",bg)	
		avatar:SetSize(35,35)
		avatar:SetPos(4,10)
		avatar:SetPlayer(ply,64)	
		
		local steamid = vgui.Create("DLabel",bg)
		steamid:SetSize(250,25)
		steamid:SetPos(215,14)
		steamid:SetText(ply:SteamID())
		steamid:SetFont("Steamid")
		steamid:SetTextColor(Color(230,230,230))
		
		local kills = vgui.Create("DLabel", bg)
		kills:SetSize(250,25)
		kills:SetPos(425,12)
		kills:SetText(ply:Frags())
		kills:SetFont("Deathkill")
		kills:SetTextColor(Color(230,230,230))
		
		local death = vgui.Create("DLabel", bg)
		death:SetSize(250,25)
		death:SetPos(465,12)
		death:SetText(ply:Deaths())
		death:SetFont("Deathkill")
		death:SetTextColor(Color(230,230,230))
		
		local ping = vgui.Create("DLabel", bg)
		ping:SetSize(250,25)
		ping:SetPos(585,12)
		ping:SetText(ply:Ping())
		ping:SetFont("Ping")
		ping:SetTextColor(Color(230,230,230))

		
end




Uh try LocalPlayer()?

What u talk about?

Replace every Ply with LocalPlayer()

Or try putting the ply = LocalPlayer() inside the GM:ScoreboardShow()