• Scoreboard creation GM / Gamemode
    2 replies, posted
I followed [URL="http://wiki.garrysmod.com/page/Basic_scoreboard_creation"]this tutorial[/URL] exactly, yet this still returns an error: [CODE][ERROR] lua/autorun/client/scoreboard.lua:15: attempt to index global 'GAMEMODE' (a nil value) 1. unknown - lua/autorun/client/scoreboard.lua:15[/CODE] This only occurs when I'm starting the map -- but the "scoreboard" doesn't even show up. I tried making it different sizes, nothing changed. My full code is as follows: [CODE]scoreboard = scoreboard or {} function scoreboard:show() --Create the scoreboard here, with an base like DPanel, you can use an DListView for the rows. local Frame = vgui.Create( "DPanel" ) Frame:SetPos( 10, 30 ) Frame:SetSize( 200, 500 ) function scoreboard:hide() -- Here you put how to hide it, eg Base:Remove() Frame:Remove() end end function GM:ScoreboardShow() scoreboard:show() end function GM:ScoreboardHide() scoreboard:hide() end [/CODE] EDIT: Used to work a lot with VGUI earlier (~1 year ago), and never had these problems. Though I never used the GM functions.
[CODE] function GM:ScoreboardShow() scoreboard:show() end function GM:ScoreboardHide() scoreboard:hide() end [/CODE] Try getting rid of the GM: prefix and turning them into hooks
[QUOTE=warlock123;49453537][CODE] function GM:ScoreboardShow() scoreboard:show() end function GM:ScoreboardHide() scoreboard:hide() end [/CODE] Try getting rid of the GM: prefix and turning them into hooks[/QUOTE] Original scoreboard remained. Sorry, but I give up on this for now. I'll look through my old files and see if I can't get something to work.
Sorry, you need to Log In to post a reply to this thread.