> For the complete documentation index, see [llms.txt](https://documentation.rcore.cz/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://documentation.rcore.cz/paid-resources/rcore_casino/config-reference/tweaking-games/lucky-wheel.md).

# Lucky Wheel

Reward pools, weights and payout settings for the Lucky Wheel.

The settings below are shared by every wheel. A reward pool applies to each wheel that picks it. Placement, price, cooldown, VIP access and society settings for an individual wheel are set on its [editor page](https://documentation.rcore.cz/paid-resources/rcore_casino/features/editor/lucky-wheel.md).

## Reward pools

Main config file: `configs/games/luckywheel.lua`, table `WheelConfigs`.

Each pool is a list of 20 segments, and the config has one pool, `default`. A wheel picks its pool through the Config setting in the editor.

<table data-full-width="false"><thead><tr><th width="230">Field</th><th>Info</th></tr></thead><tbody><tr><td><code>caption</code></td><td>Name of the prize. The wheel's info panel shows the most and least likely captions as its worst and best prize.</td></tr><tr><td><code>captionMoney</code></td><td>Use instead of <code>caption</code> for a money prize: the amount, shown in <code>Config.Currency</code>.</td></tr><tr><td><code>possibility</code></td><td>Weight. More in <a href="#weights">Weights</a>.</td></tr><tr><td><code>action</code></td><td>How the prize is awarded.</td></tr><tr><td><code>wheelSound</code></td><td>One of <code>Win_Cash</code>, <code>Win_RP</code>, <code>Win_Chips</code>, <code>Win_Car</code>, <code>Win_Mystery</code>, <code>No_Sound</code>.</td></tr><tr><td><code>pedAnimation</code></td><td>One of <code>win</code>, <code>win_big</code>, <code>win_huge</code>, or <code>nil</code> for no reaction.</td></tr><tr><td><code>societyDeduct</code></td><td>Amount taken from the wheel's society to fund this prize.</td></tr><tr><td><code>incrementProfitStats</code></td><td>Value recorded against profit statistics.</td></tr><tr><td><code>isNoWinItem</code></td><td>Marks the segment as a losing outcome.</td></tr></tbody></table>

A segment pays out with `action`, a Lua function called as `action(wheel, playerId)`. Fire a server event from it for the common prizes, or write whatever you need for anything else. This is how the drinks segment grants a bonus:

```lua
[1] = {
    caption = "DRINKS",
    action = function(wheel, playerId)
        local control = exports["rcore_casino"]:GetCasinoControl()
        control.GivePlayerBonus(playerId, "drinks", 1)
    end,
    possibility = 400,
    wheelSound = "Win_RP",
    pedAnimation = "win"
},
```

## Weights

A segment's chance is its own weight divided by the total of all 20. Weights are not percentages and don't need to add up to anything. The default pool totals 3461, so a segment weighted `400` comes up a little under 12% of the time, and one weighted `10` is 40 times rarer.

## Random item pool

The `RANDOM` segment draws from a separate pool: `LuckyWheelRandomItems`, in `const_games.lua`. It's weighted the same way as the wheel itself.

<table data-full-width="false"><thead><tr><th width="200">Field</th><th>Info</th></tr></thead><tbody><tr><td><code>inventoryName</code></td><td>Item given to the player.</td></tr><tr><td><code>title</code></td><td>Name shown in the reward notification.</td></tr><tr><td><code>amount</code></td><td>A fixed number, or a <code>{min, max}</code> table for a random range.</td></tr><tr><td><code>possibility</code></td><td>Weight, using the same method as the wheel segments.</td></tr></tbody></table>

## Wheel face models

Selectable wheel models are listed in `LuckyWheelCircles`, in `configs/games/luckywheel.lua`. By default it contains only `rcore_lucky_wheel`.

You can generate a custom wheel face, its own icons, text and colours, with the wheel creator at [casino.rcore.cz/luckywheel](https://casino.rcore.cz/luckywheel/). It produces a `.yft` model as a `.zip` with an install tutorial. Add the installed model's name to `LuckyWheelCircles` to make it selectable as a wheel's model in the editor.

<div data-full-width="false"><figure><img src="https://1037498771-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MZErcztD5BvrKnwRGJq%2Fuploads%2Fgit-blob-d68d9ca68db4c32c5dbb5bddb12ca2b03bbf3505%2Fluckywheeleditorcapt.jpg?alt=media" alt=""><figcaption></figcaption></figure></div>

## Society and payouts

A chip spin price is paid into the wheel's society. Item-priced spins and free spins add nothing. Any prize with a `societyDeduct` is taken out of it after the prize is paid. More in [Societies](https://documentation.rcore.cz/paid-resources/rcore_casino/features/societies.md).

{% hint style="warning" %}
If the society can't cover the wheel's biggest `societyDeduct`, the wheel doesn't spin and tells the player it's closed for now.
{% endhint %}
