Installation
1. Dependencies
Make sure these are installed and started before the roulette:
- Your framework:
qb-core,qbx_coreores_extended - ox_lib
- oxmysql
- vns-core - free and open source, downloaded separately from your Keymaster/cfx Portal (it is not inside the roulette zip and updates on its own)
vns-core detects your framework, inventory and notification system automatically. The roulette has no framework, inventory or notification settings of its own.
2. Resource
Copy the vns-roulette folder into your resources and start it after vns-core:
ensure qb-core # or qbx_core / es_extended
ensure ox_lib
ensure oxmysql
ensure vns-core
ensure vns-roulette
Ensure order
vns-coremust be ensured after ox_lib, oxmysql (database), your framework, inventory, target system and your other server scripts such as housing, garages and phone.vns-roulettemust be ensured aftervns-core.
If vns-core starts too early, VNS scripts can't use your database, items, money or other systems. See Installing vns-core.
The same resource works on QBCore, QBox and ESX - there is no separate build to pick.
3. Casino map
The script does not spawn roulette tables. Each entry in Config.Tables must point at an existing roulette table prop on your map. Supported models are ch_prop_casino_roulette_01a, ch_prop_casino_roulette_01b, vw_prop_casino_roulette_01, vw_prop_casino_roulette_01b and gigz_prop_casino_roulette_01b. The script recolors the cloth to the configured color and spawns a dealer ped behind the table.
The default positions match the casino interior around vector3(947.76, 56.93, 74.99). If your casino map has its tables elsewhere, update the positions in Config.Tables.
Warning
The table prop must be within 1 m of the configured position, otherwise the table is not picked up. Stand at the table in game and copy its coordinates - don't guess.
Tables and dealers are only set up once a player is within Config.Range (default 50.0) of a table.
4. Chips item
Players bet with an inventory item, casinochips by default (Config.ItemName). Add that item to your inventory's item list (for example ox_inventory/data/items.lua, your QBCore/QBox shared items, or the ESX items table). Adding and removing chips goes through vns-core, so it works with every inventory vns-core supports.
5. First start
- Start the server and check the console for errors.
- Walk to a roulette table - a dealer should be standing there, and each free chair shows a marker with a help text including the table's minimum and maximum bet.
- Give yourself some
casinochips, sit down, place a bet and wait for the countdown. The spin runs and winning bets are paid out automatically.
Encrypted variant
config.lua, client/client_open.lua and server/server_open.lua stay editable in the Encrypted variant - everything on this page and the Configuration page can be changed in both variants.
Updating from the previous version
- vns-core is now required. Install it and start it before
vns-roulette. - One resource for all frameworks. The separate QB and ESX builds are gone - replace whichever build you had with the new
vns-roulette. - Removed options:
Config.ESX,Config.OLDESXand theQBCore = exports['qb-core']:GetCoreObject()line. Framework detection is handled by vns-core. - Texts moved into
config.lua. Thelocalesfolder no longer exists; theLocalestable now sits inconfig.lua. Copy over any translations you had. Config.Rangeis now used on every framework to decide when the tables and dealers are set up.- Bets are validated server-side. The server now checks the table's minimum/maximum bet and the player's chip count before accepting a bet.
- Editable files renamed. Custom changes you made in
client.lua/server.luabelong inclient/client_open.lua/server/server_open.luanow.