legacy-scoreboard
Troubleshooting
Known gotchas and how to avoid them.
Troubleshooting
Resource errors on start / getData throws
server/server.lua calls exports['legacy-lib']:Framework() at file load time, not lazily inside a handler, and also calls exports['legacy-lib']:GetLogo() / GetAccentColor() / GetAccentGradient() inside the getData callback. If legacy-lib isn't running (or isn't started before legacy-scoreboard), the resource will error on start or the callback will throw. Make sure legacy-lib and ox_lib both start before legacy-scoreboard.
My own name shows even though I'm anonymous
This is expected. Anonymity is enforced server-side: other players' name/job/jobLabel are stripped (set to ''/nil) before the payload leaves the server, except for the requesting player's own record (an isSelf check). You will always see your own name in your own scoreboard view.
I added a job to Config.Services but its job/label never shows on player rows
Job visibility is a separate gate from service membership. Even for non-anonymous players, job/jobLabel are only revealed if the job name is present in Config.VisibleJobs. Adding a job to Config.Services only affects on-duty headcounts — you must also add it to Config.VisibleJobs to expose it on player records.
Icons don't render for a new service/activity
The icon string must exactly match a name exported by the UI's fa.jsx (Shield, Ambulance, Wrench, Taxi, Scale, Vault, Gem, Store, SackDollar, Truck, House). Adding a config entry with an unsupported icon name fails silently — no icon renders, and the web/dist bundle must be rebuilt for any UI-side icon map changes to take effect.
Job chip has a label but no color
Config.VisibleJobs only supplies the label; the chip color also requires the same job key to exist in the UI's JOB_COLORS map inside Scoreboard.jsx. If it's missing there, the label displays without color styling.
Activities never show as "open" no matter how many cops are on
Activity.open is derived exclusively from the service whose id == 'police' in Config.Services. If you renamed or removed that service's id, copsOnline is stuck at 0 and all minCops gating fails, regardless of other service groups' headcounts.
Rapid re-opens return no data
getData enforces Config.RefreshCooldownMs per player (tracked by src in an in-memory lastRequest table, cleared on playerDropped). Requests inside the cooldown window silently return nil — the client just treats this as "don't open the board", with no error or user feedback. If you're calling the export yourself in a loop, expect silent rate-limiting rather than errors.
Scoreboard NUI focus gets stuck open
The close flow is animation-driven: the client sets isOpen = true and grabs NUI focus immediately on open, but only releases focus when the NUI itself calls the close NUI callback after its exit animation finishes. If the NUI never calls back (a UI bug), focus stays stuck until onResourceStop fires as a safety fallback (e.g. on a resource restart).
Anonymity setting reset after reinstalling/renaming the resource
Anonymity is persisted via SetResourceKvpInt/GetResourceKvpInt keyed by citizenid, which is resource-local KVP storage tied to the resource's name. Renaming or reinstalling the resource folder under a different resource name will lose or orphan previously stored anonymity KVPs.