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

# Daddy Chance

Free dice, coin flip, rock paper scissors, playing cards and random numbers, shown above the player's head.

![Daddy Chance](https://2487709298-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FqcEXX242M9YYHjASblGi%2Fuploads%2Fgit-blob-a779bc38726d8865d6feeed60763b27d5a85c8e3%2Fdaddy-chance-thumbnail.jpg?alt=media)

Settle an argument with a coin, roll for your character's luck or pick who pays the bill. The result pops up above the player's head for everyone nearby, with an animation and a small sound.

{% hint style="success" %}
Daddy Chance is **free and open source**. Download it from [GitHub](https://github.com/lKrypton/daddy-chance/releases/tag/v1.0.0).
{% endhint %}

![Results above the head](https://2487709298-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FqcEXX242M9YYHjASblGi%2Fuploads%2Fgit-blob-b3b65f0e319f735fa30b83bb496e71bf5ce9efaa%2Fdaddy-chance-preview.png?alt=media)

## Features

* **Dice**: 1 to 6 dice, D2 to D100, the total is shown for more than one die
* **Coin flip**, **rock paper scissors** (pick a hand or random), **playing card** from a 52 card deck
* **Random number** between any two values
* **Above the head**: everyone within 12 m sees the result and hears the sound
* **Animations and props** for dice, coin and cards
* **`/chance` menu** with every game (ox\_lib)
* **Usable items** for ox\_inventory, QBCore or ESX
* **Cooldown** so nobody can spam the area
* Optional **chat message** with the result
* **Character names** from Qbox, QBCore or ESX, detected on its own; standalone works too
* **English and Turkish**

## Requirements

* ox\_lib
* Optional: ox\_inventory, qbx\_core, qb-core or es\_extended

## Installation

1. Download `daddy-chance.zip` from the [GitHub release](https://github.com/lKrypton/daddy-chance/releases/tag/v1.0.0) and put the `daddy-chance` folder in your `resources` folder.
2. Start it after ox\_lib in your `server.cfg`:

```cfg
ensure ox_lib
ensure daddy-chance
```

3. Restart the server.

## Commands

| Command                      | What it does                                |
| ---------------------------- | ------------------------------------------- |
| `/roll [count] [sides]`      | Roll dice, e.g. `/roll 2 6` or `/roll 1 20` |
| `/flip`                      | Flip a coin                                 |
| `/rps [rock/paper/scissors]` | Rock paper scissors, empty = random         |
| `/card`                      | Draw a playing card                         |
| `/number [min] [max]`        | Random number, e.g. `/number 1 100`         |
| `/chance`                    | Menu with every game                        |

Names and aliases are in `Config.Commands`. Set a game to `false` to turn its command off.

## Items

**ox\_inventory**: add to `ox_inventory/data/items.lua`:

```lua
['dice'] = {
    label = 'Dice', weight = 10, consume = 0,
    server = { export = 'daddy-chance.dice' },
},
['coin'] = {
    label = 'Coin', weight = 5, consume = 0,
    server = { export = 'daddy-chance.coin' },
},
['playing_cards'] = {
    label = 'Playing Cards', weight = 50, consume = 0,
    server = { export = 'daddy-chance.card' },
},
```

**QBCore / ESX** without ox\_inventory: create items named `dice`, `coin` and `playing_cards`, they become usable on their own. Item names are in `Config.Items`.

Item icons are in `install/images/` inside the download. Copy them to `ox_inventory/web/images/` (or your inventory's image folder).

## Configuration

```lua
Config = {}

Config.Language = 'en'                  -- 'en' or 'tr', see locales/
Config.Framework = 'auto'               -- 'auto', 'qbx', 'qb', 'esx' or 'standalone' (only used for character names)
Config.UseCharacterName = true          -- character name in chat, false = FiveM name

Config.DisplayDistance = 12.0           -- players within this distance see the result and hear the sound (m)
Config.DisplayDuration = 6500           -- how long the result stays above the head (ms)
Config.Cooldown = 3000                  -- time between two actions of the same player (ms)

Config.EnableSound = true               -- small sound effect for each game
Config.SoundVolume = 0.5                -- 0.1 - 1.0

Config.ChatMessage = false              -- also post the result in chat (needs the default chat resource)

Config.DefaultDiceCount = 2             -- /roll without arguments
Config.DefaultDiceSides = 6             -- D6
Config.MaxDiceCount = 6
Config.MaxDiceSides = 100
Config.MaxNumber = 1000000              -- highest value allowed in /number

-- Add your own aliases, e.g. { 'roll', 'dice', 'zar' }. false turns a command off.
Config.Commands = {
    dice = { 'roll', 'dice' },
    coin = { 'flip', 'coinflip' },
    rps = { 'rps' },
    card = { 'card', 'drawcard' },
    number = { 'number', 'random' },
    menu = { 'chance' },
}

-- ox_inventory items that start a game when used. false turns an item off.
Config.Items = {
```

Animations, card suits and card values are further down in `config.lua`. Texts live in `locales/en.lua` and `locales/tr.lua`. Copy one to add a language, keep the same keys and set `Config.Language`. A missing key falls back to English.

## Troubleshooting

* **Nothing happens**: check that ox\_lib starts before the resource.
* **"Wait a moment before playing again"**: the cooldown is running, change `Config.Cooldown`.
* **No chat message**: `Config.ChatMessage` is off by default and needs the default `chat` resource.
* **Items do nothing**: with ox\_inventory the item needs the `server.export` line above.

## Links

* Source: [github.com/lKrypton/daddy-chance](https://github.com/lKrypton/daddy-chance)
* Support: [Discord](https://discord.gg/NFKjbN9s2q)


---

# 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://daddy-studios.gitbook.io/daddy-studios-docs/free-scripts/daddy-chance.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.
