NX CreativeNX CreativeDocs
Scriptsnx_slotmachine

Configuration

Every entry in config.lua. Defaults, types, and purpose.

All player-facing settings live in config.lua. The file is in escrow_ignore so it remains editable after install.

Locked values that drive the calibrated RTP (symbol weights, payout tables, bonus weights, max-win cap, DUI panel geometry, sync radius) live in constants.lua and are not part of this page. Editing them will skew payout shape and is not supported.

Framework

Config.Frameworkstringdefault: 'ESX'

Active framework. One of 'ESX', 'QB', or 'QBOX'. Must match the framework resource you start before nx_slotmachine.

Language

Config.Localestringdefault: 'en'

Language used for game screens, notifications, and admin menus. Bundled options: 'en', 'de', 'fi', 'fr', 'pt-br', 'es', 'tr', 'nl', 'it', 'pl'.

Debug

Config.Debugbooleandefault: false

When true, prints verbose lifecycle, spin, and UI traces to the server console and F8 client console. Leave false in production.

Economy

Config.Currencystringdefault: '$'

Legacy single-currency symbol. Used as a fallback when a slot has no currency assigned, or for stripped-down setups. The Config.Currencies table below supersedes it for per-machine customization.

Config.BetAmountsnumber[]default: { 10, 50, 100, 500 }

Available bet steps. The player cycles through these in the bet selector.

Config.DefaultBetIndexnumberdefault: 1

1-based index into Config.BetAmounts that is selected on first sit.

Config.EnableBonusBuysbooleandefault: true

Bonus buys in Chroma Rush and Davy's Doubloons. Set to false to hide the Buy Feature button in game and decline buy spins on the server.

Payback rate

Config.Economy.RTPTierstringdefault: 'standard'

Share of everything staked that the machines return over a long run. 'standard' is what the four games were balanced around, at roughly 96% each. 'reduced' runs the same games at roughly 91%, scaling every win down by the same proportion so the house keeps more of what goes in.

Both tiers use the same symbol weights and the same feature frequencies. Only the size of each win changes, so the games play identically at either setting.

Pick "reduced" when you want the casino to earn more per wager. It lowers the small everyday wins by the same proportion as the large ones, which players tend to notice quickly. It does not cap how much a single lucky session can pay.

Currencies

Each slot cabinet runs on one currency. Admins assign it per cabinet through the /manageslots menu, and one global option covers the in-world Diamond Casino cabinets. Define every selectable currency in Config.Currencies.

Config.Currenciestable[]default: { { key = 'money', label = 'Cash', symbol = '$', type = 'item', item = 'money' }, { key = 'chips', label = 'Casino Chips', symbol = '◆', type = 'item', item = 'casino_chip' } }

List of currency options a slot can use. Each entry is charged on a bet and paid out on a win. See the field reference below.

Each entry takes:

  • key. Unique internal id stored in the database. Do not rename in place.
  • label. Display label shown in the /manageslots menu.
  • symbol. Short symbol drawn in the cabinet UI, for example "$", "◆", or "C".
  • type. Either "account" (framework money account) or "item" (ox_inventory item).
  • account. Required when type is "account". The framework account to charge and pay. ESX: "money", "bank", or "black_money". QB/QBox: "cash", "bank", or "crypto".
  • item. Required when type is "item". The ox_inventory item used as one chip.

The first entry is the default for newly placed slots and for the in-world casino cabinets until an admin overrides them in-game.

Config.DefaultCurrencystringdefault: nil

Optional currency key that sets which Config.Currencies entry new slots are created with. When nil, the first entry is used. Lets you reorder the menu without changing the default.

Presentation

Config.Splash.Enabledbooleandefault: true

Plays the NX Creative branded intro the first time a player sits at a machine in a session.

Config.Sounds.Enabledbooleandefault: true

UI sound effects for button clicks and reel events.

Slot placement

The placement system powers the /manageslots admin command. It controls who is allowed to open the manager, and optionally lets specific jobs purchase and place slot cabinets.

Config.SlotPlacement.TableNamestringdefault: 'nx_slotmachine_world_slots'

Database table that stores placed slot cabinets. If you change this, update sql/install.sql to match.

Config.SlotPlacement.Commandstringdefault: 'manageslots'

Chat command that opens the placement manager. Renaming this updates the registered command name.

Access

Config.SlotPlacement.Access.Adminstabledefault: { Enabled=true, ESXGroups={'admin','superadmin'}, QBPermissions={'admin'}, QBoxPermissions={'admin'}, QBoxGroups={'admin'}, AcePermissions={'command.manageslots','nx_slotmachine.manageslots'} }

Who counts as an admin for slot placement. Any one matching group, permission, or ACE check grants access.

Config.SlotPlacement.Access.Jobstabledefault: { Enabled=false, DefaultPrice=0, Allowed={} }

Optional job-based access. When Enabled, listed jobs may place machines for a price. Each entry in Allowed is keyed by job name and takes the shape { minGrade = number, price = number }.

Economy analytics

Records what the machines do to your economy and adds an Economy Analytics entry inside /manageslots. The dashboard is admin only.

The resource writes one row per player, per machine, per sitting. Each row holds the totals for that sitting: spins, amount staked, amount paid out, currency, game, start and end. Every question the dashboard answers is a total, so it does not write a row per spin.

There is no retention setting and no rollup job. A row is a few hundred bytes.

Config.Analytics.Enabledbooleandefault: true

Enables session recording and the Economy Analytics dashboard. Set to false to write nothing and hide the dashboard entry.

Config.Analytics.SessionTablestringdefault: 'nx_slotmachine_sessions'

Database table holding one row per sitting. Change this before you have data. Renaming it later leaves the old table behind with your history in it.

Config.Analytics.NotableTablestringdefault: 'nx_slotmachine_notable_rounds'

Database table holding the full frame sequence of recorded notable rounds. Same renaming caveat as SessionTable.

Notable rounds

Config.Analytics.NotableMultipliernumberdefault: 500

Any round paying at least this many times its stake is recorded in full and can be replayed spin by spin from the dashboard. Raise it to record only the largest outliers, lower it to catch more.

The unit is a round, not a spin: one paid spin plus every free spin it bought. A win this size is usually a bonus built up over many spins, and a single grid out of context does not explain it.

Replay loads the real game page and plays the recorded results back through it, so what you watch is the cabinet the player saw.

Config.Analytics.MaxReplayFramesnumberdefault: 400

Maximum frames stored for one round. A round that reaches this cap is still stored and still replayable, and is marked as shortened in the dashboard.

Config.Analytics.MaxReplayBytesnumberdefault: 1048576

Maximum stored JSON size for one round, in bytes. Default is 1 MB. Same shortened-round behavior as MaxReplayFrames.

Write behavior

Config.Analytics.FlushSpinsnumberdefault: 25

How often a sitting's running totals are written back to the database, counted in spins. Lower loses less if the server stops mid-session, higher writes less often. Totals are always written when the player stands up.

Config.Analytics.CacheSecondsnumberdefault: 20

Seconds to reuse the last overview result before recomputing it. Stops the server-wide totals being recalculated every time an admin reopens the panel.

Every aggregate is keyed by currency and the dashboard renders each currency separately, so two currencies are never added together.

Database

Config.TrinityMemory.TableNamestringdefault: 'nx_slotmachine_trinity_memory'

Database table that persists each player's Trinity Heist crew-role state across reconnects. If you change this, update sql/install.sql to match.

NX Docs