Documentation
R_Casino

r_casino Configuration

r_casino config.lua explained: framework, NPC, coin system, reward delivery, enabling games, game history, win notifications, Discord roles and logs.

Everything lives in a single config.lua. This page covers the general settings. Game odds and limits are on the Games page, and the case catalog on Creating Cases.

Framework Settings

R.Framework = "qbx"           -- Options: ESX, qbcore, qbx
R.newESX = true               -- if you use ESX 1.1 set this to false
R.CoreName = "es_extended"    -- rename if your es_extended is renamed
R.Inventory = "ox_inventory"  -- Options: ESX, qb-inventory, ox_inventory, quasar

NPC Interaction

R.UseTarget = false           -- true to enable targeting the npc
R.Target = "ox_target"        -- Options: ox_target, qb-target

With R.UseTarget = false, players get a Text UI prompt ([E] - Open Casino) when near the NPC instead.

Coin System

By default the casino keeps its own coin balance per player in r_casino_players:

R.UseRStoreCoins = false

Grant coins with /giveCasinoCredits [id] [amount] (console) or the exports. A player's row is created the first time they open the casino or receive coins, so exports and console commands work for players who have never visited the casino.

Store Shortcut

Show a store button in the casino header:

R.EnableStore = false         -- true to show a store button in the casino
R.StoreResourceName = "r_store"
R.StoreCommand = "store"      -- command that opens the store

Reward Delivery

Case rewards of type money are paid into this account, and vehicle rewards are parked in this garage (QBCore / QBX; ESX vehicles are simply stored):

R.MoneyCurrency = "bank"
R.VehicleGarage = "pillboxgarage"

Commands & Hotkey

R.GiveCreditCommand = "giveCasinoCredits" -- console: /giveCasinoCredits [id] [amount]
R.OpenCasinoCommand = "casino"            -- user: open the casino

R.EnableFastKey = true
R.ToggleKey = "F5"
R.KeyText = "Open casino"

Enabling & Disabling Games

Hide any game from the UI with one switch. Disabled games are also rejected server-side:

R.EnabledGames = {
    cases = true,
    coinflip = true,
    mines = true,
    crash = true,
    plinko = true,
    blackjack = true,
}

UI

One hex colour themes the whole interface, plus how history dates are shown and whether case drop chances are visible:

R.UI = {
    Accent = "#9a27ea",            -- one accent colour for the whole interface
    DateFormat = "D.M.YYYY HH:mm", -- history dates -> 22.9.2026 18:42
    ShowCaseOdds = true,           -- show each item's drop chance in a case
}

DateFormat tokens: YYYY / YY year, MM / M month, DD / D day (with / without leading zero), HH / H 24-hour, hh / h 12-hour, mm minutes, ss seconds, A / a AM/PM. Anything else is printed as is, so "DD/MM/YYYY HH:mm" gives 22/09/2026 18:42 and "MM/DD/YYYY hh:mm A" gives 09/22/2026 06:42 PM.

With ShowCaseOdds = true every item in a case shows its exact drop chance. The percentages are derived from R.Games.Cases.RarityChances the same way the server rolls: the rarity's share is split evenly between the items of that rarity, and a rarity with no items passes its share on to the next one down.

Interface Colours

Every R-Scripts resource shares the same colour tokens, so you can match the UI to your server's branding without touching any code:

R.UI = {
    Accent = "#9a27ea",        -- icons, bars, badges and highlights
    Primary = "#ffffff",       -- main action buttons (buy / play / confirm)
    PrimaryText = "#000000",   -- text on those buttons
    NavActive = "",            -- selected tab background, "" keeps the neutral default
    NavActiveText = "#ffffff", -- selected tab text
}

Leave a value empty to keep the shipped look — the defaults above are exactly what you see out of the box. Accent stays a signal colour (icons, progress bars, badges); Primary is the solid button colour, so setting it to your brand colour turns every confirm button at once.

Game History

Every finished round is saved to r_casino_history and shown to the player on the History page (the clock icon in the header) and in the Last games list in each game's sidebar:

R.History = {
    Enabled = true,   -- false hides the History page and stops recording
    KeepDays = 30,    -- rows older than this are deleted on resource start (0 = keep forever)
    Limit = 100,      -- how many of the player's latest games the UI loads
}

Players only ever see their own games. The page loads at most Limit rows, but the Wagered, Net and Games boxes are counted on the server across every row the history still holds, so they stay correct no matter how much the player has played. A line under the list says how many of the total are shown.

Win Notifications

Announce big wins to the whole server:

R.EnableWinNotifications = true     -- notify all players when someone wins big
R.WinNotificationThreshold = 5000   -- minimum win amount to trigger the notification

Discord Role Restrictions

Only needed when a case uses requiredRole:

R.Discord = {
    Enabled = false,          -- true to enable Discord role checks
    Type = "trase",           -- Options: trase (trase_discord), badger (Badger_Discord_API)
}

Required resources: trase_discord or Badger_Discord_API.

Discord Logs

R.Enablelogs = true

Set the webhook URLs at the top of server/sv_custom.lua. There is a separate webhook per game (Cases, Coinflip, Mines, Crash, Plinko, Blackjack) plus Admin. Webhooks left as placeholders are skipped silently.

NPC & Blip

R.EnablePed = true
R.Ped = {
    Model = "s_m_y_casino_01",
    Scenario = "WORLD_HUMAN_STAND_IMPATIENT",
    Location = vector4(925.3286, 46.5176, 81.1063, 148.8192),
}

R.EnableBlip = true
R.BlipSettings = {
    Name = "Casino",
    Pos = vector3(925.3286, 46.5176, 81.1063),
    Sprite = 617,
    Display = 4,
    Scale = 0.7,
    Colour = 1,
}

Other Settings

R.Debug = false               -- print debug output to the server console
R.EnableAutoinsert = true     -- auto-create SQL tables on first start

Auto-insert also adds the uq_player_identifier unique index to an existing r_casino_players table from older versions. It never changes any row. If the table already contains duplicate identifiers the index is skipped and a warning with the fix is printed on start.