scoreboard problems


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:

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: )

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 )

Useful Programs ( SteamCMD, Autosizer, Desktops, Process Explorer ) and Notepad++ Upgrades

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! )