> For the complete documentation index, see [llms.txt](https://docs.warostudios.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.warostudios.com/scripts/casino.md).

# Casino Games

An online casino players open on a tablet, with eleven games and every outcome decided by the server.

## Overview

`waro_casino` is a whole casino on a tablet. Players open it anywhere in the city, move money into a casino wallet and play: Lucky Bandit Blackjack, six slots and four instant games. There is no building to place and no map edit.

The server decides every result. The tablet only shows what the server already decided.

![The casino lobby](https://2612295190-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FzMuOgpGkBFTwz05ofriR%2Fuploads%2Fgit-blob-ae7eca735070666fe7c9661d79290033ddf7efe8%2Flobby.jpg?alt=media)

## Features

* **Eleven games:** Lucky Bandit Blackjack, six slots with free spins and a bonus buy, and four instant games.
* **Server-side results:** every card, reel stop, bounce and crash point is drawn on the server.
* **Return to player you set:** each game's RTP is in `config.lua` (96% by default).
* **Shared jackpots:** Grand and Major pools that grow with every slot spin on the server.
* **Casino wallet:** players deposit from bank or cash and withdraw back, with full bet history.
* **Your own art and names:** swap any symbol, background or title, or rename a game.
* **Discord log** for deposits, withdrawals, big wins and jackpots (optional).
* **Light:** 0.00 ms while the tablet is closed. Each game loads its art only when it's opened.

## Requirements

| Resource   | Needed?                           |
| ---------- | --------------------------------- |
| `ox_lib`   | Yes                               |
| `oxmysql`  | Yes                               |
| `waro_lib` | Yes (free, comes with the script) |

Works on Qbox, QBCore and ESX, with ox\_inventory, qb-inventory (ps / lj) or the ESX inventory.

## Installation

1. Drag `waro_casino` into your `resources` folder.
2. In `server.cfg`, start it after `waro_lib`:

```cfg
ensure ox_lib
ensure oxmysql
ensure waro_lib
ensure waro_casino
```

3. Add the **Casino Tablet** item to your inventory. Ready-to-paste files are in the script's `install/` folder:

{% tabs %}
{% tab title="ox\_inventory" %}
Paste into `ox_inventory/data/items.lua`, inside `return { ... }`:

```lua
['casino_tablet'] = {
    label = 'Casino Tablet',
    weight = 600,
    stack = false,
    close = true,
    description = 'Slots, mines, plinko and more, wherever you are.',
    client = { export = 'waro_casino.useTablet' },
},
```

{% endtab %}

{% tab title="qb-inventory" %}
Paste into `qb-core/shared/items.lua`, inside `QBShared.Items = { ... }`:

```lua
['casino_tablet'] = { name = 'casino_tablet', label = 'Casino Tablet', weight = 600, type = 'item', image = 'casino_tablet.png', unique = true, useable = true, shouldClose = true, description = 'Slots, mines, plinko and more, wherever you are.' },
```

{% endtab %}

{% tab title="ESX" %}
Run once on your database:

```sql
INSERT IGNORE INTO `items` (`name`, `label`, `weight`) VALUES ('casino_tablet', 'Casino Tablet', 1);
```

{% endtab %}
{% endtabs %}

4. Give your staff the test command:

```cfg
add_ace group.admin waro_casino.staff allow
```

5. Restart the server. The database tables are created automatically.

{% hint style="info" %}
The item image isn't included. Put a `casino_tablet.png` in your inventory's images folder if you want one.
{% endhint %}

## The games

| Game                       | How it plays                                                                                                                             |
| -------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------- |
| **Lucky Bandit Blackjack** | Pick chips, deal, then hit, stand, double, split or take insurance. 6 decks, dealer stands on soft 17, blackjack pays 3 to 2.            |
| **Sugar Rush**             | 7 or more of a candy anywhere pays. Winners pop and new candy falls in. Crown wilds carry a multiplier. 4+ lollipops give 10 free spins. |
| **Deep Sea Loot**          | 243 ways with tumbles. 3+ chests give 10 free spins where wilds carry ×2 to ×10.                                                         |
| **Vault Breakers**         | 20 lines. 6+ vaults start Hold & Win: vaults lock with cash and every new one resets the 3 respins.                                      |
| **Pharaoh's Fortune**      | 20 lines. Wilds fill their whole reel. 3+ pyramids give 8 free spins where wild reels stay wild.                                         |
| **Cosmic Snacks**          | Clusters of 5+ pay and pop. Each tumble in a row climbs a multiplier up to ×50.                                                          |
| **Lantern Night**          | 10 lines. Lanterns light the whole reel. 3 gongs give 8 free spins where lit reels stay lit.                                             |
| **Gem Dig**                | Mines: pick 1 to 24 bombs, dig for gems and cash out whenever you like.                                                                  |
| **Neon Drop**              | Plinko with 8, 12 or 16 rows and low, medium or high risk.                                                                               |
| **Afterburn**              | Crash: cash out before the rocket blows, or set an auto cash-out.                                                                        |
| **Rush Hour Hop**          | Cross the road lane by lane. Every lane raises the multiplier. Four traffic levels.                                                      |

Every slot has a paytable, autoplay, turbo and a bonus buy with a confirm step.

![Sugar Rush](https://2612295190-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FzMuOgpGkBFTwz05ofriR%2Fuploads%2Fgit-blob-c3072438cfe78b73a2a199c2ccfddddbe202caa7%2Fsugar-rush.jpg?alt=media)

![Lucky Bandit Blackjack](https://2612295190-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FzMuOgpGkBFTwz05ofriR%2Fuploads%2Fgit-blob-20521696380732ee0b92b1786aa91842e46a29a9%2Fblackjack.jpg?alt=media)

![Rush Hour Hop](https://2612295190-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FzMuOgpGkBFTwz05ofriR%2Fuploads%2Fgit-blob-1b2c3c179bbdaadf5055d9726c97dc27814195da%2Frush-hour-hop.jpg?alt=media)

## The wallet

Players **deposit** from their bank or cash into a casino wallet and **withdraw** back to either. Every game is played from the wallet. Limits are in `Config.wallet`.

## Jackpots

Two shared pools, **Grand** and **Major**, grow from a small share of every slot bet. Any slot spin can hit one. The pool pays out and starts again from its seed. Pools are saved to the database. Set them in `Config.jackpots`.

## Fairness

* Every outcome is drawn on the server. The blackjack shoe stays on the server, and the hole card is only sent once the dealer turns it.
* Each game's RTP is set in `Config.games` (96% by default). For slots, the jackpot share comes out of the slot's RTP, so the total stays at your number.
* Bets are checked against your limits, each player's actions run one at a time, and the wallet can't spend the same dollar twice.
* On start, the server warns in the console about settings that would break a game or pay out more than it takes in.

Measured at the default 96%:

| Game                   | Result                                   |
| ---------------------- | ---------------------------------------- |
| Slots                  | 95.1% to 96.5% over 4,000,000 spins each |
| Gem Dig, Rush Hour Hop | 95.3% to 96.0% at every setting          |
| Neon Drop              | 96.00% exactly                           |
| Afterburn              | 96% at any cash-out target               |
| Blackjack              | House edge 0.49% with basic strategy     |

## Leaving mid-round

| Game                   | What happens                                                                                                          |
| ---------------------- | --------------------------------------------------------------------------------------------------------------------- |
| Blackjack              | Open hands stand, the dealer finishes and the round is paid.                                                          |
| Gem Dig, Rush Hour Hop | Progress is cashed out. A round with nothing dug or crossed is refunded.                                              |
| Afterburn              | The tablet can't close while your rocket flies. If you leave the server, an auto cash-out still pays if it's reached. |
| Slots                  | The result is paid the moment you spin.                                                                               |

If the script stops, open rounds are cashed out, refunded or finished.

## Configuration

Everything is in `config.lua`. Restart `waro_casino` after changing it.

| Option                 | What it does                                                                                    |
| ---------------------- | ----------------------------------------------------------------------------------------------- |
| `Config.item`          | The tablet item (`casino_tablet`).                                                              |
| `Config.requireItem`   | `true`: players need the item. Set `false` to open it from a phone app.                         |
| `Config.command`       | Staff command that opens the casino without the item (`casino`).                                |
| `Config.staffAce`      | Permission for the staff command (`waro_casino.staff`).                                         |
| `Config.prop`          | The tablet model and animation while the casino is open.                                        |
| `Config.wallet`        | Deposit accounts, minimum and maximum deposit, and the wallet cap.                              |
| `Config.games`         | Per game: on/off, name, RTP, allowed bets, max win and bonus buy.                               |
| `Config.blackjack`     | Decks, reshuffle point, soft 17, blackjack payout, splits, insurance and the chips on the rail. |
| `Config.jackpots`      | Each pool's seed, share of every bet and odds.                                                  |
| `Config.historySize`   | Bets kept in each player's history.                                                             |
| `Config.webhookMinWin` | Smallest win (in dollars) sent to the Discord log.                                              |
| `Config.art`           | Your own images (see below).                                                                    |

The Discord log webhook goes in `server.cfg`, not the config:

```cfg
set waro_casino:webhook "https://discord.com/api/webhooks/..."
```

### Renaming a game

Change the game's `label`. The painted games have their name in the title art, so set `titleArt = false` and the tablet writes your label instead:

```lua
pharaoh = { enabled = true, label = 'Sands of Gold', titleArt = false, ... },
```

### Your own art

Put your image in `html/custom/` and name it in `Config.art`:

```lua
Config.art = {
    ['sugarrush.gummy-bear'] = 'my-bear.png',
    ['deepsea.background'] = 'reef.jpg',
    ['vault.title'] = 'my-logo.png',
}
```

Keys are `<game>.<symbol>`, `<game>.background`, `<game>.foreground`, `<game>.frame` or `<game>.title`. The symbol names for each slot are in the script's `README.md`.

## Commands & keybinds

| Command or key                 | Who     | What it does                                                                     |
| ------------------------------ | ------- | -------------------------------------------------------------------------------- |
| Use the **Casino Tablet** item | Players | Opens the casino. The tablet is held while open.                                 |
| `/casino`                      | Staff   | Opens the casino without the item.                                               |
| **Esc**                        | Players | Closes a dialog, or the tablet.                                                  |
| **Space**                      | Players | Spins, deals, drops a ball, launches, hops or cashes out, depending on the game. |
| **H / S / D / P**              | Players | Blackjack: hit, stand, double, split.                                            |

The tablet closes on its own if the player dies or is knocked down.

## For developers

Client exports:

```lua
exports.waro_casino:open()     -- opens the casino (the item is still needed if Config.requireItem)
exports.waro_casino:close()
exports.waro_casino:isOpen()   -- true while the tablet is open
```

Server exports:

```lua
exports.waro_casino:getWallet(source)   -- wallet balance in dollars
exports.waro_casino:getJackpots()       -- { { id, label, amount }, ... }
```

## FAQ

<details>

<summary>Can players open the casino from a phone?</summary>

Yes. Set `Config.requireItem = false` and call `exports.waro_casino:open()` from your phone app.

</details>

<details>

<summary>Can I change how much the casino pays back?</summary>

Yes. Each game's `rtp` in `Config.games` sets it. Keep it below `1.0` (100%). Blackjack's return comes from its rules in `Config.blackjack`.

</details>

<details>

<summary>Where is the money saved?</summary>

In the `waro_casino_wallets` table. Every bet, deposit, withdrawal and jackpot is in `waro_casino_bets`, and the pools are in `waro_casino_jackpots`. They're created automatically.

</details>

<details>

<summary>A player left in the middle of a hand. Did they lose it?</summary>

No. Blackjack hands are finished and paid, and mines and road crossings are cashed out. See [Leaving mid-round](#leaving-mid-round).

</details>


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.warostudios.com/scripts/casino.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
