scoreboard problems

Hello,

I am working on a gamemode and I want to create a custom scoreboard but It keeps on using the base gamemode’s scoreboard and not mine that is in the gamemode folder and is added to init.lua. I looked multiple times on here and looked at other gamemodes but I can’t find the solution.

You should probably learn the difference between clientside and serverside before you try to work on a gamemode.

Sorry, I meant I did “AddCSLuaFile(“cl_scoreboard.lua”)” in init.lua

You also need to change the hooks: https://dl.dropboxusercontent.com/u/26074909/tutoring/vgui/open_menu_key_tap_open_and_key_hold_release_close.lua.html

function GM:ScoreboardShow( )
function GM:ScoreboardHide( )

You need to overwrite them and redirect them to open your scoreboard; otherwise it’ll just use the base game-mode system… You could do hook.Add, but if you’re writing a game-mode, overwrite the GM functions…

And, adding a little bit of additional information below; if you want an easy way to create a game-mode ( ie never needing to worry about include or AddCSLuaFile, check out my skeletonized dev base… Releasing the SQL Query Builder some time tonight or tomorrow which generates SELECT, INSERT and UPDATE queries ranging from super simple to very complex like gathering data from 3 tables across many rows and merging it into 1 returned row using 1 query as seen in this example: https://dl.dropboxusercontent.com/u/26074909/tutoring/database/sql_query_builder_example_1.lua.html )

NOTE: AddCSLuaFile only tells the SERVER that the client needs to download it. You still need to have the CLIENT include the file somewhere, otherwise it is downloaded but not used.

Hopefully these tutorials and information helps. As always, to view the Lua from any of my tutorials to enable copy/pasting ( HTML doesn’t copy/paste well in terms of HTML / CSS Highlighted Lua ), remove .html from the url.

Hey, welcome to FacePunch. This forum is for devs that need help working on things. Here are some resources to help you get started:

Generalized Lua Help ( Links to Wikis, Answers the question of “Where do I post a simple question or DarkRP Specific question”, links to other resources compiled by forum members )
https://dl.dropboxusercontent.com/u/26074909/tutoring/___welcome_docs/_welcome_general_lua_learning.lua.html

Useful Programs ( SteamCMD, Autosizer, Desktops, Process Explorer ) and Notepad++ Upgrades
https://dl.dropboxusercontent.com/u/26074909/tutoring/___welcome_docs/_welcome_useful_programs_and_notepadpp_upgrades.lua.html

AcecoolDev_Base Skeletonized Dev Base Game-Mode ( Never worry about Include or AddCSLuaFile ever again; comes with New Hooks, Console Commands, Meta-Table Objects, Helper Functions, Extended Functionality, and more! )
https://dl.dropboxusercontent.com/u/26074909/tutoring/___welcome_docs/_welcome_acecooldev_base_gamemode_info.lua.html