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

# xakra\_roulette

## Requirements

* [vorp\_menu](https://github.com/VORPCORE/vorp_menu)
* [vorp\_core](https://github.com/VORPCORE/vorp-core-lua)
* [vorp\_inventory](https://github.com/VORPCORE/vorp_inventory-v2)

***

## Installation

1. Copy the script into a folder (to choose) from the 'resources' folder.
2. Add 'ensure xakra\_roulette' and 'ensure roulettewheel' in the 'Resources.cfg' document
3. Configure the 'config.lua' to adapt the script to your server.

***

## Config & Framework

<details open>

<summary>config</summary>

config.lua

{% code expandable="true" %}

```lua
Config = {}

Config.Lang = 'es'  -- 'en', 'es' 

Config.Align = 'top-left'   -- 'center', 'top-left' or 'top-right'

-- Keys: https://github.com/femga/rdr3_discoveries/tree/master/Controls
Config.Keys = {
    Open = 'INPUT_INTERACT_OPTION1',    -- G
}

-- Blips: https://github.com/femga/rdr3_discoveries/tree/master/useful_info_from_rpfs/textures/blips
-- Colors modifiers: https://github.com/femga/rdr3_discoveries/tree/master/useful_info_from_rpfs/blip_modifiers
Config.Locations = {
    {   -- BLACKWATER TABERN
        RotationDuration = 30,   -- seconds (Rotation time when the roulette wheel chooses a number)
        Style = 'Wood', -- Metal, Rusty, Wood, WoodOld, WoodOldDirty
        Base = 'Floor', -- Floor, Wall
        Name = 'Blackwater Roulette',
        Time = 180,  -- seconds (Time that players will have to place bets)
        Roulette = { Coords = vector3(-809.01, -1326.02, 43.85), Heading = -87.85, SpawnDist = 180 },
        Bet = { Coords = vector3(-810.51, -1325.84, 43.68), Radius = 3.0 },
        Blip = { Enable = true, Name = 'blip_mp_coach_smuggle', Color = 'BLIP_MODIFIER_MP_COLOR_11' },
        AmountBets = 2, -- number (Number of times it can bet on a roll) or false
        Multiplier = {
            [1] = 2,
            [3] = 3,
            [5] = 5,
            [10] = 10,
            [20] = 20,
        },
        CurrencyesBet = {
            {
                type = 0,   -- 0 = money, 1 = gold, 2 = rol
                typec = 'money',   -- 'money', 'gold', or 'rol'
                label = '$',    -- notification text
                MenuLabel = 'Money',    -- Text in the menu
                MaxBet = 50,  -- number or false
                Image = 'nui://vorp_inventory/html/img/items/money.png',
            },
            {
                type = 1,   -- 0 = money, 1 = gold, 2 = rol
                typec = 'gold',   -- 'money', 'gold', or 'rol'
                label = ' gold',    -- notification text
                MenuLabel = 'Gold',    -- Text in the menu
                MaxBet = false,  -- number or false
                Image = 'nui://vorp_inventory/html/img/items/gold.png',
            },
        },
        ItemsBet = {
            -- {
            --     item = 'sulfur',
            --     label = 'Sulfur',
            --     MaxBet = 10,  -- number or false
            --     Image = 'nui://vorp_inventory/html/img/items/sulfur.png',
            -- },
            -- {
            --     item = 'iron',
            --     label = 'Iron ore',
            --     MaxBet = 25,  -- number or false
            --     Image = 'nui://vorp_inventory/html/img/items/iron.png',
            -- },
            -- {
            --     item = 'wood',
            --     label = 'Softwood',
            --     MaxBet = 25,  -- number or false
            --     Image = 'nui://vorp_inventory/html/img/items/wood.png',
            -- },
            -- {
            --     item = 'hwood',
            --     label = 'Hardwood',
            --     MaxBet = 15,  -- number or false
            --     Image = 'nui://vorp_inventory/html/img/items/hwood.png',
            -- },
        },
    },
    {   -- SAINT DENIS TABERN
        RotationDuration = 30,   -- seconds (Rotation time when the roulette wheel chooses a number)
        Style = 'Wood', -- Metal, Rusty, Wood, WoodOld, WoodOldDirty
        Base = 'Floor', -- Floor, Wall
        Name = 'Saint Denis Roulette',
        Time = 180,  -- seconds (Time that players will have to place bets)
        Roulette = { Coords = vector3(2630.45, -1228.95, 53.55), Heading = -179.22, SpawnDist = 180 },
        Bet = { Coords = vector3(2630.51, -1229.057, 53.83), Radius = 5.0 },
        Blip = { Enable = true, Name = 'blip_mp_coach_smuggle', Color = 'BLIP_MODIFIER_MP_COLOR_11' },
        AmountBets = 2, -- number (Number of times it can bet on a roll) or false
        Multiplier = {
            [1] = 2,
            [3] = 3,
            [5] = 5,
            [10] = 10,
            [20] = 20,
        },
        CurrencyesBet = {
            {
                type = 0,   -- 0 = money, 1 = gold, 2 = rol
                typec = 'money',   -- 'money', 'gold', or 'rol'
                label = '$',    -- notification text
                MenuLabel = 'Money',    -- Text in the menu
                MaxBet = 50,  -- number or false
                Image = 'nui://vorp_inventory/html/img/items/money.png',
            },
            -- {
            --     type = 1,   -- 0 = money, 1 = gold, 2 = rol
            --     typec = 'gold',   -- 'money', 'gold', or 'rol'
            --     label = ' gold',    -- notification text
            --     MenuLabel = 'Gold',    -- Text in the menu
            --     MaxBet = false,  -- number or false
            --     Image = 'nui://vorp_inventory/html/img/items/gold.png',
            -- },
        },
        ItemsBet = {
            {
                item = 'sulfur',
                label = 'Sulfur',
                MaxBet = 10,  -- number or false
                Image = 'nui://vorp_inventory/html/img/items/sulfur.png',
            },
            {
                item = 'iron',
                label = 'Iron ore',
                MaxBet = 25,  -- number or false
                Image = 'nui://vorp_inventory/html/img/items/iron.png',
            },
            {
                item = 'wood',
                label = 'Softwood',
                MaxBet = 25,  -- number or false
                Image = 'nui://vorp_inventory/html/img/items/wood.png',
            },
            {
                item = 'hwood',
                label = 'Hardwood',
                MaxBet = 15,  -- number or false
                Image = 'nui://vorp_inventory/html/img/items/hwood.png',
            },
        },
    },
    {   -- SAINT DENIS YACHT
        RotationDuration = 30,   -- seconds (Rotation time when the roulette wheel chooses a number)
        Style = 'Wood', -- Metal, Rusty, Wood, WoodOld, WoodOldDirty
        Base = 'Floor', -- Floor, Wall
        Name = 'Casino Roulette',
        Time = 180,  -- seconds (Time that players will have to place bets)
        Roulette = { Coords = vector3(2890.06, -1419.70, 46.16), Heading = -129.67, SpawnDist = 180 },
        Bet = { Coords = vector3(2890.06, -1419.70, 46.44), Radius = 5.0 },
        Blip = { Enable = true, Name = 'blip_mp_coach_smuggle', Color = 'BLIP_MODIFIER_MP_COLOR_11' },
        AmountBets = 2, -- number (Number of times it can bet on a roll) or false
        Multiplier = {
            [1] = 2,
            [3] = 3,
            [5] = 5,
            [10] = 10,
            [20] = 20,
        },
        CurrencyesBet = {
            {
                type = 0,   -- 0 = money, 1 = gold, 2 = rol
                typec = 'money',   -- 'money', 'gold', or 'rol'
                label = '$',    -- notification text
                MenuLabel = 'Money',    -- Text in the menu
                MaxBet = 50,  -- number or false
                Image = 'nui://vorp_inventory/html/img/items/money.png',
            },
            -- {
            --     type = 1,   -- 0 = money, 1 = gold, 2 = rol
            --     typec = 'gold',   -- 'money', 'gold', or 'rol'
            --     label = ' gold',    -- notification text
            --     MenuLabel = 'Gold',    -- Text in the menu
            --     MaxBet = false,  -- number or false
            --     Image = 'nui://vorp_inventory/html/img/items/gold.png',
            -- },
        },
        ItemsBet = {
            {
                item = 'sulfur',
                label = 'Sulfur',
                MaxBet = 10,  -- number or false
                Image = 'nui://vorp_inventory/html/img/items/sulfur.png',
            },
            {
                item = 'iron',
                label = 'Iron ore',
                MaxBet = 25,  -- number or false
                Image = 'nui://vorp_inventory/html/img/items/iron.png',
            },
            {
                item = 'wood',
                label = 'Softwood',
                MaxBet = 25,  -- number or false
                Image = 'nui://vorp_inventory/html/img/items/wood.png',
            },
            {
                item = 'hwood',
                label = 'Hardwood',
                MaxBet = 15,  -- number or false
                Image = 'nui://vorp_inventory/html/img/items/hwood.png',
            },
        },
    },
    {   -- VAN HORN TABERN
        RotationDuration = 30,   -- seconds (Rotation time when the roulette wheel chooses a number)
        Style = 'WoodOld', -- Metal, Rusty, Wood, WoodOld, WoodOldDirty
        Base = 'Floor', -- Floor, Wall
        Name = 'Van Horn Roulette',
        Time = 180,  -- seconds (Time that players will have to place bets)
        Roulette = { Coords = vector3(2951.16, 519.29, 45.56), Heading = -90.35, SpawnDist = 180 },
        Bet = { Coords = vector3(2951.16, 519.29, 45.84), Radius = 5.0 },
        Blip = { Enable = true, Name = 'blip_mp_coach_smuggle', Color = 'BLIP_MODIFIER_MP_COLOR_11' },
        AmountBets = 2, -- number (Number of times it can bet on a roll) or false
        Multiplier = {
            [1] = 2,
            [3] = 3,
            [5] = 5,
            [10] = 10,
            [20] = 20,
        },
        CurrencyesBet = {
            {
                type = 0,   -- 0 = money, 1 = gold, 2 = rol
                typec = 'money',   -- 'money', 'gold', or 'rol'
                label = '$',    -- notification text
                MenuLabel = 'Money',    -- Text in the menu
                MaxBet = 50,  -- number or false
                Image = 'nui://vorp_inventory/html/img/items/money.png',
            },
            -- {
            --     type = 1,   -- 0 = money, 1 = gold, 2 = rol
            --     typec = 'gold',   -- 'money', 'gold', or 'rol'
            --     label = ' gold',    -- notification text
            --     MenuLabel = 'Gold',    -- Text in the menu
            --     MaxBet = false,  -- number or false
            --     Image = 'nui://vorp_inventory/html/img/items/gold.png',
            -- },
        },
        ItemsBet = {
            {
                item = 'sulfur',
                label = 'Sulfur',
                MaxBet = 10,  -- number or false
                Image = 'nui://vorp_inventory/html/img/items/sulfur.png',
            },
            {
                item = 'iron',
                label = 'Iron ore',
                MaxBet = 25,  -- number or false
                Image = 'nui://vorp_inventory/html/img/items/iron.png',
            },
            {
                item = 'wood',
                label = 'Softwood',
                MaxBet = 25,  -- number or false
                Image = 'nui://vorp_inventory/html/img/items/wood.png',
            },
            {
                item = 'hwood',
                label = 'Hardwood',
                MaxBet = 15,  -- number or false
                Image = 'nui://vorp_inventory/html/img/items/hwood.png',
            },
        },
    },
    {   -- ARMADILLO TABERN
        RotationDuration = 30,   -- seconds (Rotation time when the roulette wheel chooses a number)
        Style = 'WoodOld', -- Metal, Rusty, Wood, WoodOld, WoodOldDirty
        Base = 'Floor', -- Floor, Wall
        Name = 'Armadillo Roulette',
        Time = 180,  -- seconds (Time that players will have to place bets)
        Roulette = { Coords = vector3(-3709.57, -2591.83, -13.13), Heading = 89.91, SpawnDist = 180 },
        Bet = { Coords = vector3(-3709.57, -2591.83, -12.85), Radius = 5.0 },
        Blip = { Enable = true, Name = 'blip_mp_coach_smuggle', Color = 'BLIP_MODIFIER_MP_COLOR_11' },
        AmountBets = 2, -- number (Number of times it can bet on a roll) or false
        Multiplier = {
            [1] = 2,
            [3] = 3,
            [5] = 5,
            [10] = 10,
            [20] = 20,
        },
        CurrencyesBet = {
            {
                type = 0,   -- 0 = money, 1 = gold, 2 = rol
                typec = 'money',   -- 'money', 'gold', or 'rol'
                label = '$',    -- notification text
                MenuLabel = 'Money',    -- Text in the menu
                MaxBet = 50,  -- number or false
                Image = 'nui://vorp_inventory/html/img/items/money.png',
            },
            -- {
            --     type = 1,   -- 0 = money, 1 = gold, 2 = rol
            --     typec = 'gold',   -- 'money', 'gold', or 'rol'
            --     label = ' gold',    -- notification text
            --     MenuLabel = 'Gold',    -- Text in the menu
            --     MaxBet = false,  -- number or false
            --     Image = 'nui://vorp_inventory/html/img/items/gold.png',
            -- },
        },
        ItemsBet = {
            {
                item = 'sulfur',
                label = 'Sulfur',
                MaxBet = 10,  -- number or false
                Image = 'nui://vorp_inventory/html/img/items/sulfur.png',
            },
            {
                item = 'iron',
                label = 'Iron ore',
                MaxBet = 25,  -- number or false
                Image = 'nui://vorp_inventory/html/img/items/iron.png',
            },
            {
                item = 'wood',
                label = 'Softwood',
                MaxBet = 25,  -- number or false
                Image = 'nui://vorp_inventory/html/img/items/wood.png',
            },
            {
                item = 'hwood',
                label = 'Hardwood',
                MaxBet = 15,  -- number or false
                Image = 'nui://vorp_inventory/html/img/items/hwood.png',
            },
        },
    },
}
```

{% endcode %}

webhooks.lua

{% code expandable="true" %}

```lua
Webhooks = {
    Win = '',
    Lost = '',
}
```

{% endcode %}

</details>

<details open>

<summary>framework</summary>

client.lua

{% code expandable="true" %}

```lua
MenuData = exports.vorp_menu:GetMenuData()

local VORPcore = exports.vorp_core:GetCore()

function NotifyObjective(text, time)
    VORPcore.NotifyObjective(text, time)
end

LabelOpenBetsSize = '35px'
LabelBetSize = '25px'
ImageBetSize = '50px'
```

{% endcode %}

server.lua

{% code expandable="true" %}

```lua
local VORPcore = exports.vorp_core:GetCore()

function NotifyAvanced(source, title, dict, icon, color, time)
    VORPcore.NotifyAvanced(source, title, dict, icon, color, time)
end

function NotifyObjective(source, text, time)
    VORPcore.NotifyObjective(source, text, time)
end

function GetCharacter(source)
    -- .charIdentifier
    -- .firstname
    -- .lastname
    -- .money
    return VORPcore.getUser(source).getUsedCharacter
end

function addCurrency(source, currency, amount)
    local Character = GetCharacter(source)
    Character.addCurrency(currency, amount) -- Add money 1000 | 0 = money, 1 = gold, 2 = rol
end

function addItem(source, item, amount, metadata, callback)
    exports.vorp_inventory:addItem(source, item, amount, metadata, callback)
end

function subItem(source, item, amount)
    exports.vorp_inventory:subItem(source, item, amount)
end

function getItemCount(source, callback, item, metadata)
    return exports.vorp_inventory:getItemCount(source, callback, item, metadata)
end

function removeCurrency(source, currency, amount)
    local Character = GetCharacter(source)
    Character.removeCurrency(currency, amount)
end

function AddWebhook(title, webhook, description, color, name, logo, footerlogo, avatar)
    VORPcore.AddWebhook(title, webhook, description, color, name, logo, footerlogo, avatar)
end
```

{% endcode %}

</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 dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://xakra-scripts.gitbook.io/xakra-scripts-docs/redm-docs/xakra_roulette.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
