All products

np_billiards

Pool in the bars of Los Santos, on GTA's own tables. Walk up to the table in the Yellow Jack Inn or Tequi-la-la, challenge whoever is standing around, put money in escrow and play 8-ball, 9-ball or straight pool. The server runs the ball physics and referees every shot, the bar watches and bets, and the Pool League app keeps the standings.

v1.0.0ESX · qbx · qb · standaloneRequires oxmysqlRequires np_prophandler 1.1.0+
Price TBAStore link follows at release
Installation guideDocumentation
Version
1.0.0
Frameworks
ESX, qbx, qb, standalone
Dependencies
oxmysql, np_prophandler 1.1.0+
Database
Tables created on start
Inventory
np_inventory, ox_inventory, qb-inventory, ESX
Optional
np_payments, np_hud, np_phone, np_menu, np_admin and more
Languages
English
Build
Node 18+ to build the NUI once
Aiming in the overhead cam: the ghost ball on the 3 with the object-ball and cue-ball stubs, the called corner pocket, the spin widget on the cue-ball face with elevation, the stroke power pips, the score 1 to 1 in a race to 3 for $950 and the drink sway chip
Aiming in the overhead cam: the ghost ball on the 3 with the object-ball and cue-ball stubs, the called corner pocket, the spin widget on the cue-ball face with elevation, the stroke power pips, the score 1 to 1 in a race to 3 for $950 and the drink sway chip

Taken from the NUI in the browser at 1920×1080, with mock data.

What's in it

The server simulates and judges every shot. Your client replays the same shot and snaps to the server's result.

GTA's own tables

  • Binds to the vanilla pool tables in the bars. np_prophandler hides the map balls, rack and cue on them while it owns the table, and its own balls stay visible.
  • Or spawn a table anywhere: player-owned bars, custom MLOs, or an export.

Deterministic physics

  • Sliding and rolling friction, follow, draw and stun, side spin with squirt and throw, english off the cushions, masse and jaws.
  • Fixed 5 ms steps with continuous collision detection, so the same strike gives the same bits on the server and every client.

The server is the referee

  • 8-ball with called pockets, open table, groups and ball in hand. 9-ball with the golden break and the three-foul rule.
  • Straight pool (14.1) with called balls, fouls and the re-rack. Every shot is logged.

Stakes and side bets

  • Both stakes are taken when the challenge is accepted and held in escrow, fees and the house cut go to the bar.
  • Spectators bet into a pari-mutuel pool that locks while balls move. Players can't bet on their own match.

Rank and gear

  • ELO per mode, tiers from Fish to Legend, seasons, rivals and achievements.
  • Cues, shafts, chalk and gloves are items with tip wear, wraps and a league-legal cap on ranked tables.

Works with your server

  • ESX and np_inventory first, also qbx, qb, ox_inventory, qb-inventory or the ESX inventory.
  • A bar owner tablet, cups and the Pool League app in np_phone.
  • Staff permissions through np_admin, no ox_lib, no ACE.

A closer look

Stroke, don't click

Press E at a table (or "Play pool" in np_menu) to open the lobby. C switches between the overhead and the shoulder cam.

The overhead cam: ghost ball, stubs, the called pocket, the spin widget and the stroke pips
  1. Aim at the mouse in the overhead cam (Shift = fine), or drag with the right button in the shoulder cam. The ghost ball shows object-ball and cue-ball stubs, by cue stat.
  2. Spin with W A S D on a real cue-ball face with a miscue rim, Q and E for elevation. V calls a pocket, X a safety.
  3. Stroke: hold the left button, pull back, push through. The push speed is the power and sideways drift is angle error. P switches to an assisted click-hold-release stroke.
  4. Drinks make it a bar: one steadies the hand, from two the sway ellipse around the ghost ball grows, from five the camera swims.

8-ball, 9-ball and straight pool

The server simulates every shot and judges it. Every shot is logged with its ball, cut angle, spin and rails.

Ball in hand after a scratch, with the shot log and the rule phases
The shoulder cam with the guide drawn on the table
GameThe referee checks
8-ballCalled pocket, open table, groups, the 8, the 8 on the break, illegal breaks, scratches, ball in hand anywhere or in the kitchen
9-ballLowest ball first, the golden break, the three-foul rule
Straight pool14.1: called balls, −1 for fouls, −15 on three, the 14-ball re-rack, race to N points
  • Fouls: scratch, no contact, wrong ball, no rail, illegal break and the shot clock, each a server event.
  • R replays the last shot slowly, T extends the shot clock. Leaving mid-match forfeits, a crash gets a 90 s rejoin window.

Stakes, spectators and side bets

Spectators within 8 m get the HUD, cycle the cameras with TAB, react with 1 to 5 and open the side bets with B.

Spectating: the side bet pool with odds, props, the bar chatter and the crowd reactions
PartHow it works
StakesBoth taken when the challenge is accepted, held in escrow and paid out minus the house cut. A restart refunds anything still held
FeesTable fees, the house cut and the rake go to the bar's society
Side betsA pari-mutuel pool on the winner, "next ball down is a stripe" and hill-hill, paid minus the bar's rake
Fair playBets lock while balls move, players can't bet on their own match, odd results on big pools are flagged to staff
CrowdClap, ooh, toast, heckle and cheer with vanilla animations. Heckles add a sway pulse

ELO, seasons and the cue case

/poolprofile opens your profile, /cuecase the cue case. H chalks the cue at the table.

Profile: the tier, the ELO chart, style stats, form, a rival and achievements
The cue case: loadout, stat deltas, owned gear, wraps and tip wear
  • ELO overall and per mode with a provisional K. Tiers Fish, Hustler, Shark and Legend (III to I), six-week seasons with a soft reset.
  • Achievements: golden break, table runner, comeback kid, bar crawler, liquid courage, hustler, lucky 8, lockdown and century.
  • Cues: house cues everywhere. Owned cues, shafts, chalk and gloves are items with a serial, tip wear, racks, wins and break-and-runs.
  • Stats trade power for touch, and ranked tables cap the total. Tips wear and are re-tipped with a kit, wraps unlock with achievements.

Bar owners, referees and cups

Give a bar an owner and a referee (a job and grade), then /poolroom opens the owner tablet.

The owner tablet: tables with live balls, cloth, revenue, a cup and the house rules
  • Tables with live balls and cloth wear. Recover the cloth for $400 and the table closes for an hour.
  • Revenue of the last 7 days: fees, house cut, rake and upkeep.
  • Referees pause or void a match, with stakes and bets refunded.
  • Cups: single elimination seeded by ELO, entries in escrow, called matches, walkovers after a no-show and a prize split with the rake to the bar.

The Pool League app

With np_phone running, Pool League is in the phone's app store, and the Dynamic Island shows the live score and "your shot".

Standings: your rank and the top of the tableCups: the prize pool and the live bracketChallenges: accept one and challenge players
  • Standings for the whole server or your bar.
  • Cups with live brackets.
  • Remote challenges with escrow on accept, played later at that bar.
  • Open tables nearby, and watching a live match from the phone.

Set it up

Compatibility

ESX with np_inventory is the first target. np_prophandler 1.1.0 or newer is required. Every other integration is optional, detected with GetResourceState and called through pcall.

InventoryItems
np_inventoryCue, shaft, chalk, glove and re-tip kit registered at runtime, with metadata and a busy lock while playing
ESX inventoryImport sql/items_esx.sql
ox_inventoryPaste the five items from the docs into data/items.lua
qb-inventoryThrough the same bridge
SiblingWhat np_billiards does with it
np_paymentsTable fees to the bar, stakes, bet and cup entries through Charge, refunds through Refund
np_hudChallenge toasts with Accept and Decline, the table prompt, zone claims while playing
np_phoneThe Pool League app, push notifications and the Dynamic Island
np_menu"Play pool" and "Owner tablet" on the table props
np_adminPermission nodes, live settings, staff actions, the audit log and the server theme
np_drugsBlood alcohol for the aim sway, or esx_status drunk

Also detected: np_discord for match, void, cup and flag logs, np_character for names on standalone, and esx_addonaccount, qb-banking, qb-management or Renewed-Banking for the bar's society income. GTA V has no pool minigame script, so nothing of Rockstar's runs at the tables.

Installation

The tables are created on the first start. You build the NUI once.

  1. Put the resource in resources/ as np_billiards and build the NUI once (Node 18+), web/dist is not committed:
    cd web && npm ci && npm run build
  2. Items: np_inventory needs nothing. For the ESX inventory import sql/items_esx.sql, for ox_inventory paste the items from the docs.
  3. Start it after its dependencies:
    ensure oxmysql
    ensure es_extended
    ensure np_inventory     # optional
    ensure np_payments      # optional
    ensure np_hud           # optional
    ensure np_phone         # optional
    ensure np_prophandler   # required, 1.1.0+
    ensure np_billiards
  4. Give your bars an owner in config/tables.lua, for example owner = { job = 'yellowjack', grade = 3 }. Fees, the house cut and the rake go to that society.

For your own scripts

Server exports for ratings, tables, matches, cups, drinks and cues, and server events for every match, rack, foul and settled bet.

-- your own bar: a table prop in your MLO
exports.np_billiards:RegisterTable({ id = 'mybar_1', bar = 'mybar', label = 'Table 1',
  model = 'prop_pooltable_02', coords = vector3(0.0, 0.0, 0.0), heading = 90.0 })

-- a drink from your bar script counts for the sway
exports.np_billiards:SetDrinks(src, 2, 600)

-- a Friday cup at the Yellow Jack
exports.np_billiards:CreateCup('yellowjack', { name = 'Friday 9-Ball', mode = '9ball', size = 8, entry = 100 })
  • Server: GetPlayerPoolRating, GetTableState, GetMatch, IsPlaying, StartMatch, VoidMatch, GiveCue.
  • Events: matchStarted, matchEnded, rackEnded, foul, goldenBreak, breakAndRun, betSettled and cupEnded.
  • Client: IsPlaying, IsOpen, OpenLobby and OpenCase.

Questions

Which frameworks does it support?

es_extended first, then qbx_core and qb-core, detected at start. Without a framework it runs standalone and uses np_character for names when it runs.

Do I need np_inventory?

No. np_inventory is the first target: the cues and their parts register on their own and keep serial, wear and history in metadata. The ESX inventory, ox_inventory and qb-inventory work with the item lists from the docs.

Does every player see the same shot?

Yes. The physics use fixed 5 ms steps and only basic arithmetic inside the loop, so the same strike gives the same result on the server and every client. Clients replay the shot and snap to the server's result.

Where are the tables?

The vanilla tables in the Yellow Jack Inn and Tequi-la-la are configured. Add your own bars in config/tables.lua or with RegisterTable, on prop_pooltable_02 or prop_pooltable_3b.

Does it use ACE permissions?

No. Staff tools check the np_admin nodes np_billiards.admin, np_billiards.owner and np_billiards.referee. Without np_admin, the console, the fallback identifiers and the ESX admin groups count.

Can I change the rules and the physics?

Yes. Game modes, house rules, gear, friction, restitution and spin decay are plain Lua config files. With np_admin running, most settings can be edited live in Resource settings.

Which languages does it ship?

English. The texts are in a locale file, so a translation is one more file.

Works well with

Build once, ensure it, rack 'em up.

Installation, every config key and every export are in the docs.

Install np_billiards