Configuration ​
Everything is in config/, one file per area. All of them are shared (client and server), so nothing secret goes in
there. Money is whole dollars, distances are metres. With np_admin running, most tunables are
also on its Resource settings page under Billiards (see Editable in np_admin).
| File | What |
|---|---|
main.lua |
Locale, bridges, integrations, currency, look, money accounts, distances, keys, match, bets, crowd, ELO, drinks, cups, phone app, staff command |
tables.lua |
Table models (playfield, ball plane, pockets), house rule defaults, bars (tables, owner, society, referee, house rules), vanilla props to hide |
rules.lua |
Game modes, rule phases, achievements |
gear.lua |
Item names, cues, shafts, tips, chalk, gloves, wraps, the league cap, how stats become physics |
physics.lua |
Friction, restitution, spin, step size, cloth wear and recovery, replay frame rate |
natives.lua |
Props, cue attachment, animations, crowd reactions, frontend sounds, cameras |
Core (main.lua) ​
| Option | Default | Description |
|---|---|---|
Config.Debug |
false |
Debug output |
Config.Locale |
'en' |
Locale of server texts and the NUI |
Config.Framework |
'auto' |
'esx', 'qbx', 'qb', 'standalone', or auto-detect (esx → qbx → qb → standalone) |
Config.Inventory |
'auto' |
'np_inventory', 'ox', 'qb', 'esx', 'none', or auto-detect (np_inventory first) |
Config.Society |
'auto' |
Bar society accounts: 'esx' (esx_addonaccount), 'qb' (qb-banking / qb-management), 'renewed' (Renewed-Banking), 'none' |
Config.Payments |
'auto' |
np_payments for fees, stakes and bets. 'auto' = when started, false = never, true = required (charges fail while it isn't running) |
Config.UseNpHud, UseNpPhone, UseNpInventory, UseNpMenu, UseNpDrugs, UseNpDiscord |
'auto' |
'auto' = used while started, false = never. See Bridges & integrations |
Config.DiscordChannel |
'billiards' |
np_discord log channel |
Config.Currency, Config.Thousands |
'$', ',' |
Money formatting |
Config.Material |
'server' |
NUI material: 'server' (np_admin's server theme), 'frosted' or 'liquid' |
Config.Brand |
nil |
A brand colour for this resource only (nil = server theme) |
Config.Scale |
nil |
NUI zoom (nil = max(0.75, innerHeight / 1080)) |
Config.PayAccount |
'bank' |
Stakes, fees and bets are taken from 'bank' or 'cash' |
Config.PayoutAccount |
'bank' |
Winnings go to 'bank' or 'cash' |
Config.Admin.command |
'pooladmin' |
The staff command |
Config.StandaloneMoney |
{ cash = 500, bank = 5000 } |
In-memory wallet per character without a framework (lost on restart) |
Config.AutoCreateTables |
true |
Create the np_billiards_* tables on start |
Optional keys that aren't in the shipped file: Config.RateLimit = { perSecond = 15, burst = 30, maxPayload = 32768 }
(token bucket and payload size over every RPC), Config.BlipSprite (93, the bar blip) and
Config.DefaultOwnedCue ('ridgeback', the cue an item without metadata stands for).
Distances ​
| Option | Default | Description |
|---|---|---|
prompt |
2.2 |
The E Rack 'em up prompt |
play |
4.0 |
Server: shooters must stand this close to their table |
spectate |
8.0 |
Live updates, the spectator HUD and side bets |
marker |
12.0 |
The floating table marker |
challenge |
15.0 |
Players listed as opponents in the lobby |
Keys ​
Config.Keys = { interact = 'E', camera = 'C', callPocket = 'V', chalk = 'H', replay = 'R', safety = 'X', bets = 'B', spectateCam = 'TAB', leave = 'BACK' }. interact, bets and spectateCam are the defaults of key mappings players
can rebind; the rest are read by the NUI while it is your shot. See Keys.
Match ​
| Option | Default | Description |
|---|---|---|
defaultRace, maxRace |
3, 9 |
Race to N racks, and the longest race anyone may set |
shotClock |
30 |
Default shot clock (s). Bars override it in their house rules; the break gets 15 s on top |
extension |
30 |
One extension per player and rack (s) |
challengeTimeout |
60 |
A challenge at the table expires after (s). Remote challenges from the phone live an hour, accepted ones six |
rejoinSeconds |
90 |
A crashed player may rejoin within this; then the match is forfeited |
aimBroadcastMs |
250 |
Spectators and the opponent see the shooter's aim this often |
breakAlternates |
true |
false = the winner of a rack breaks |
maxSimMsPerFrame |
4 |
Server: the simulation yields after this much work per frame |
Bets and crowd ​
| Option | Default | Description |
|---|---|---|
Config.Bets.enabled |
true |
Spectator side bets |
Config.Bets.rake |
5 |
% of every pool to the bar |
Config.Bets.min, max |
10, 5000 |
Bet limits |
Config.Bets.presets |
{ 25, 50, 100, 250 } |
Quick amounts in the bet panel |
Config.Bets.flagUnderperform |
0.5 |
Flag a big-pool upset when the favourite potted under 50 % of their usual rate |
Config.Bets.flagAmount |
2000 |
… from this pool size |
Config.Crowd.cooldown |
4 |
s between reactions per spectator |
Config.Crowd.heckleCooldown |
20 |
s between heckles per spectator |
Config.Crowd.meterDecay |
4 |
Crowd meter points lost per second |
ELO and seasons ​
| Option | Default | Description |
|---|---|---|
start |
1200 |
Starting rating |
k, kProvisional, provisionalGames |
24, 40, 20 |
K factor, and the faster one for players with fewer than 20 games |
seasonDays |
42 |
Season length (six weeks) |
softReset |
0.25 |
At a new season the rating moves 25 % of the way towards its tier floor |
rankedOnly |
true |
Only staked or cup matches move ELO; friendlies are recorded but don't move it |
Drinks ​
| Option | Default | Description |
|---|---|---|
enabled |
true |
Drinks make the aim sway |
bacPerDrink |
0.3 |
np_drugs blood alcohol (‰) that counts as one drink |
esxPerDrink |
100000 |
esx_status drunk (0 … 1,000,000) per drink |
steady |
0.9 |
One drink: stroke error × 0.9 ("liquid courage") |
swayPerDrink |
0.35 |
Degrees of aim error per drink from the second |
maxDrinks |
8 |
Cap |
camSwimFrom |
5 |
The script camera swims (DRUNK_SHAKE) from this many drinks |
Cups and phone ​
| Option | Default | Description |
|---|---|---|
Config.Cups.enabled |
true |
Bar cups |
Config.Cups.sizes |
{ 4, 8, 16, 32 } |
Bracket sizes an owner may pick |
Config.Cups.maxEntry |
10000 |
Highest entry fee |
Config.Cups.maxRake |
20 |
Highest cup rake (%) |
Config.Cups.callTimeout |
300 |
s a called player has to show up before the opponent may claim a walkover |
Config.Phone |
{ appId = 'np_billiards', name = 'Pool League', icon = 'fa-solid fa-circle-dot', tint = 'green', description = … } |
The np_phone app. Installed by default unless you add default = false |
Tables and bars (tables.lua) ​
Table models ​
The playfield centre is center in the prop's local X / Y, the long axis is local Y.
| Field | prop_pooltable_02 |
prop_pooltable_3b |
Description |
|---|---|---|---|
label, size |
Bar table, 9 ft | Bar table, 9 ft | Shown in the marker and lobby |
center |
-0.072891, 0.128571 |
0.000109, 0.000571 |
Playfield centre in the prop's frame |
length, width |
2.708311, 1.539878 |
the same | Cushion nose to cushion nose (m) |
ballZ |
0.89 |
0.89 |
Ball centre above the prop origin |
ballRadius |
0.04 |
0.04 |
|
cornerCut, sideGap |
0.11, 0.072 |
the same | Pocket mouths |
Use /pooladmin calibrate to draw the cushions, jaws and pockets on the felt while tuning.
House rule defaults ​
Config.HouseDefaults applies to every bar; a bar's house and the owner tablet override it (defaults < bar config
< owner overrides).
| Key | Default | Description |
|---|---|---|
fee |
5 |
Table fee ($), charged to the challenger when a match starts (cup matches are free) |
feeSplit |
false |
true: both players pay half |
houseCut |
5 |
% of the stakes to the bar (0–10) |
stakeMax |
2500 |
Highest stake per player |
race |
3 |
Default race |
shotClock |
30 |
s, 0 = off |
callPocket |
true |
8-ball: call the pocket |
ballInHand |
'anywhere' |
After a foul: 'anywhere' or 'kitchen' (behind the head string) |
eightOnBreak |
'win' |
8-ball: 'win' or 'respot' |
threeFoul |
true |
9-ball: three fouls in a row lose the rack |
raceTo14 |
50 |
Straight pool: points to win (10–150) |
drinksAffectAim |
true |
|
heckling |
true |
Spectators may heckle |
spectatorBets |
true |
|
modes |
{ '8ball', '9ball', 'straight' } |
Modes offered at this bar |
guide |
'full' |
Aim guide: 'full' (ghost ball and both stubs), 'short', 'ghost' (ghost ball only), 'none' |
ranked |
true |
Staked matches here move ELO |
Bars ​
Config.Bars.yellowjack = {
label = 'Yellow Jack Inn', icon = 'beer-mug-empty', blip = true,
coords = vector3(1992.803, 3047.312, 46.22865),
owner = nil, society = nil, referee = nil, -- e.g. owner = { job = 'yellowjack', grade = 3 }
house = { fee = 5, houseCut = 5, stakeMax = 2500 },
tables = {
{ id = 'yellowjack_1', label = 'Table 1', coords = vector3(1992.803, 3047.312, 46.22865), world = true },
},
}
| Field | Description |
|---|---|
label, icon, blip |
Name, Font Awesome icon, map blip (sprite 93) |
coords |
Bar position (phone distance, blip, cup announcements) |
owner |
{ job, grade }: who opens the owner tablet. nil = the house runs the bar |
society |
Society account for fees, house cut and rake (default: owner.job) |
referee |
{ job, grade }: who may pause and void matches |
house |
House rule overrides for this bar |
tables |
{ id, label, coords, world = true } binds to the vanilla prop within 3 m (any model in Config.Models); { id, label, model, coords, heading } spawns the prop |
Shipped: yellowjack (fee $5, stake limit $2,500) and tequilala (fee $10, stake limit $5,000), one vanilla table
each. Config.VanillaBallModels lists the props hidden on bound tables.
Modes and achievements (rules.lua) ​
| Mode | Label | Scoring | Rule phases |
|---|---|---|---|
8ball |
8-Ball · Solids vs stripes, call the 8 | racks | break, open, groups, eight, rack |
9ball |
9-Ball · Lowest ball first, fast racks | racks | break, run, rack |
straight |
Straight · 14.1 continuous, race to 50 | points | break, run, rack |
enabled = false hides a mode; Config.ModeOrder sets the order. Config.Achievements lists the
achievements; a wrap field unlocks a cue wrap.
Gear (gear.lua) ​
| Option | Description |
|---|---|
Config.Items |
Item names: cue = 'pool_cue', shaft = 'pool_shaft', chalk = 'pool_chalk', glove = 'pool_glove', tipKit = 'pool_tip_kit' |
Config.Cues |
Cue models with stats 0–100 (power, touch, steady, guide, deflection), tier and price. See the cues |
Config.Shafts, Config.Tips, Config.Chalks, Config.Gloves, Config.Wraps |
The rest of the cue case |
Config.LeagueCap |
330: stat total ranked tables allow |
Config.GearScale |
How stats become physics |
Config.GearScale |
Default | Effect |
|---|---|---|
baseSpeed, powerSpeed |
8.0, 3.0 |
Top strike speed = base + power / 100 × powerSpeed (m/s) |
squirt |
0.035 |
rad of squirt at full side, × (1 − deflection / 100 × 0.8) |
maxOffset |
0.62 |
Tip offset at full spin (fraction of the radius), + touch / 100 × 0.08 |
miscue |
0.86 |
Offset above which the tip slips (chalk, tip and touch add to it, a worn tip takes away) |
error |
0.22 |
Degrees of stroke error at steady 0, × (1 − steady / 100 × 0.7) |
guide |
0.9 |
Guide stub length (m) at guide 100 |
chalkDrain |
0.18 |
Grip lost per spin shot (× the spin amount) |
Physics (physics.lua) ​
| Option | Default | Description |
|---|---|---|
muSlide, muRoll, muSpin |
0.2, 0.011, 0.044 |
Sliding, rolling and spin friction |
muBall, muCushion |
0.06, 0.18 |
Ball–ball and ball–cushion friction (throw, english off the rail) |
eBall, eCushion |
0.95, 0.78 |
Restitution |
cushionSpinKeep, curve |
0.75, 0.35 |
Spin kept off a cushion, masse curve |
dt, maxTime, maxSpeed |
0.005, 30, 12 |
5 ms steps, longest shot (s), top ball speed |
Config.Cloth |
{ wearPerRack = 0.25, maxSlow = 0.5, recoverCost = 400, recoverClosedMinutes = 60 } |
Every rack wears the cloth by 0.25 %; at 0 % rolling resistance is × 1.5. Recovering costs $400 and closes the table for an hour |
Config.Replay |
{ recordSteps = 4, slowMo = 0.5 } |
Clients animate a frame every 4 physics steps; the replay (R) runs at half speed |
Server and clients run the same numbers, so change them on both (they are shared).
Native assets (natives.lua) ​
| Option | Description |
|---|---|
Config.Props |
balls ([0] = 'prop_poolball_cue', prop_poolball_1 … _15), cue, triangle, rack |
Config.CueAttach |
{ bone = 28422, pos, rot }: the cue in the right hand |
Config.CueProp |
{ length = 1.45, stroke = 0.22, pitch = -90.0 }: the cue on the aim line |
Config.Anims |
hold, lean, chalk, win, lose (dict, clip, flag, ms) |
Config.Reactions |
The five crowd reactions: id, label, icon, anim, meter points, heckle |
Config.Sounds |
select, back, nav, error, win, lose, clock, timeout, turn, moment as { name, soundset } |
Config.DrunkShake |
'DRUNK_SHAKE' |
Config.Camera |
overhead (height 3.1, fov 50), shoulder (back 0.75, up 0.32, fov 42), player, follow, ease 450 ms |
The full list of names is on the overview.
Editable in np_admin ​
With np_admin running, these keys are on its Resource settings page under Billiards
(shared/np_admin_settings.lua). np_admin stores only the overrides; config/ stays the default. The settings are
listed even while np_billiards is stopped. UseNpPhone applies after a restart, Locale, Currency, Material and
UseNpMenu when the NUI loads again; everything else applies live.
| Category | Keys |
|---|---|
| General | Debug, Locale, Currency, Material, PayAccount, PayoutAccount, Distance.play (2–10 m), Distance.spectate (3–30 m) |
| House rules | HouseDefaults.fee, .houseCut (0–10 %), .stakeMax, .race, .shotClock, .callPocket, .ballInHand, .eightOnBreak, .drinksAffectAim, .heckling, .spectatorBets, .guide |
| Match | Match.maxRace, Match.extension, Match.challengeTimeout, Match.rejoinSeconds, Match.breakAlternates |
| Bets & crowd | Bets.enabled, Bets.rake (0–20 %), Bets.min, Bets.max, Bets.flagAmount, Crowd.cooldown, Crowd.heckleCooldown |
| Rating | Elo.start, Elo.k, Elo.kProvisional, Elo.seasonDays, Elo.softReset, Elo.rankedOnly |
| Drinks | Drunk.enabled, Drunk.bacPerDrink, Drunk.swayPerDrink, Drunk.camSwimFrom |
| Cups | Cups.enabled, Cups.maxEntry, Cups.maxRake, Cups.callTimeout |
| Physics | Physics.muRoll, Physics.eCushion, Cloth.wearPerRack, Cloth.recoverCost |
| Integrations | Payments, UseNpHud, UseNpPhone, UseNpInventory, UseNpMenu, UseNpDrugs, UseNpDiscord, DiscordChannel |
The house rule keys here are the server-wide defaults. A bar's own house and its owner's overrides still win.