FORTUNE COOKIE

FORTUNE COOKIE is a FiveM script by Risk Scripts, compatible with ESX, QBCore and QBox, available for 14.99 EUR as a one-time purchase. It idles at 0.00ms, ships with free lifetime updates and is supported 24/7 through the Risk Scripts Discord. This edition is fully open source, so the complete Lua stays readable and editable.

FORTUNE COOKIE
Overview

FORTUNE COOKIE - features, frameworks and installation

# Fortune Cookie — Free Usable Item with Crack Animation for FiveM


**Free. Use the item, click the cookie, it cracks in two and the fortune is waiting inside.**


Risk Fortune Cookie is a FiveM fortune cookie script for ESX, QBCore and QBox, also known as a lucky cookie or Chinese fortune cookie item. The escrow version is a free FiveM script: no price, no subscription. Players use the item from their inventory, a realistic cookie appears in the middle of the screen, and a click cracks it in two with sound and falling crumbs while the paper fortune is revealed. After the paper is closed the character eats the cookie with the eating animation and gets a little hunger back. 40 ready fortunes in one editable file, optional rewards and cooldown, works with ox_inventory, qb-inventory, qs-inventory (Quasar), codem-inventory and origen_inventory, no dependencies. 0.00ms idle.


---


## Why this one


Most item scripts show a notification. This one turns a single item into a moment players remember.


- **Free, with nothing held back.** The escrow version costs nothing and has every feature on this page. The open source version with the full code is a separate paid package.

- **A real cookie, not a popup.** A photo-realistic fortune cookie in the middle of the screen. Click it and it cracks with a sound, crumbs fall, and the paper fortune is uncovered right between the two halves, at the same size the whole time.

- **The item is only used up when it cracks.** Close the screen before you click and the cookie stays in your inventory.

- **Works with your inventory.** `ox_inventory`, `qb-inventory`, `qs-inventory` (Quasar), `codem-inventory`, `origen_inventory` and the native ESX, QBCore and QBox inventory are detected automatically.

- **40 fortunes ready, all in one file.** `config/fortunes.lua` is a plain list. Change, delete or add texts in any language, the file is not escrowed.


---


## What the Player Sees


| Step | What happens |

| --- | --- |

| **1. Use** | The player uses the `fortune_cookie` item from the inventory |

| **2. Cookie** | A fortune cookie floats in the middle of the screen, ready to be clicked |

| **3. Click** | One click on the cookie |

| **4. Crack** | Crack sound, crumbs fall, the cookie breaks along a jagged line and the halves fly left and right |

| **5. Fortune** | The paper strip is uncovered between the halves with the fortune text readable at once |

| **6. Close** | Click anywhere or press `ESC`, the screen fades out |

| **7. Eat** | The character eats the cookie with the eating animation and gets a little hunger back |


If the player closes the screen before clicking, nothing is lost. The server takes the item at the moment of the click, not when the item is used.


---


## The Crack Animation


The whole screen is built around one moment: the cookie breaking.


- **Realistic cookie.** A golden fortune cookie cut in two halves with a jagged, crumbly edge on the break.

- **Sound.** A dry crack when the cookie breaks. Volume is one number in the config, `0` is silent.

- **Crumbs and light.** Crumbs burst out of the crack, fall down and drop off the screen, and a short light runs along the crack in your color.

- **Paper behind the cookie.** Fixed in size and uncovered while the halves move out, never stretched.


---


## 40 Fortunes in One File


40 fortunes ship ready in `config/fortunes.lua`, a plain list with one text per line. Change them, delete them or write your own in any language: Glückskeks, galleta de la fortuna, biscuit chinois, biscotto della fortuna, gelukskoekje or biscoito da sorte, the paper says whatever your server wants.


The same player never gets the same fortune twice in a row. The few other texts and messages sit at the top of the same file, ready to translate.


---


## A Cookie Players Can Eat


The fortune cookie is a real consumable food item. When the player closes the paper, the character eats the cookie with the standard eating animation and the server adds hunger: through `esx_status` on ESX, through the player metadata on QBCore and QBox. `Config.Eat.Hunger` sets the percent, `0` keeps the animation only, and one switch turns eating off.


---


## Optional Rewards and Cooldown


Both are off by default and switch on with one line each.


- **Reward chance.** Set a percentage of cookies that hold a small extra: money to cash or bank, or an item. Add as many entries as you like, each with its own amount range and weight. The reward shows on the paper under the fortune.

- **Cooldown.** Players wait a number of seconds between two cookies, so a stack of them cannot be farmed for rewards.


---


## Where to Use It


| Server | How it fits |

| --- | --- |

| **Restaurant and food job servers** | Give a cookie with the meal from your Chinese restaurant or takeaway script |

| **Servers with shops** | Sell it in any `ox_inventory` shop, `qb-shops` or an NPC shop opened with `ox_target` or `qb-target` |

| **Event servers** | Lunar New Year, holidays and community events, hand them out as gifts |

| **Reward and quest systems** | A daily reward, quest reward or battle pass prize |

| **New servers** | Works out of the box, one item and no setup beyond that |

| **International communities** | Write the fortunes in any language, translate the few screen texts in the same file |


---


## Built for Your Other Scripts


One item, one export. Any script that can give an inventory item can give a cookie.


```lua

-- Give a cookie with the meal from your restaurant script (ox_inventory)

exports.ox_inventory:AddItem(source, 'fortune_cookie', 1)


-- ESX: reward a player from any job or quest script

xPlayer.addInventoryItem('fortune_cookie', 1)


-- Open a cookie without the item, for a vending machine, event or quest

exports['risk-fortunecookie']:OpenFortuneCookie(source)

```


Item definitions for `ox_inventory`, QBCore shared items and an ESX SQL line are included in the `_items` folder.


---


## Secure by Design


- The **server** takes the item, picks the fortune and rolls the reward. The client cannot ask for either.

- Early clicks, double clicks and spam are ignored, and a session cleans itself up on disconnect.


---


## Compatibility


| | Supported |

| --- | --- |

| **Framework** | ESX · QBCore · QBox, auto-detected at runtime |

| **Inventory** | ox_inventory · qb-inventory · qs-inventory (Quasar) · codem-inventory · origen_inventory · native ESX / QBCore / QBox |

| **Shops and jobs** | Any script that can give an inventory item, plus a server export |

| **Target** | Not needed, works with `ox_target` and `qb-target` shop NPCs |

| **Database** | None |

| **Dependencies** | None |

| **Notify** | GTA notify, or plug in your own, for example risk-notify, with one function |

| **Hunger** | `esx_status` on ESX · player metadata on QBCore and QBox, optional |

| **Languages** | English included, every text, message and fortune can be translated in `config/fortunes.lua` |

| **Screens** | 720p to 4K and ultrawide |


---


## What You Get


- ✅ Free escrow version with every feature, no subscription

- ✅ Realistic fortune cookie that cracks in two halves on click

- ✅ Crack sound and falling crumbs

- ✅ Paper fortune uncovered between the halves, text readable at once

- ✅ 40 ready fortunes in one open file, write your own in any language

- ✅ Eating animation and hunger after the fortune, one switch

- ✅ Every text and message translatable in one file

- ✅ Item only used up when the cookie cracks

- ✅ Optional reward chance with money or items

- ✅ Optional cooldown between cookies

- ✅ Server export to open a cookie from any script

- ✅ Item files for ox_inventory, qs-inventory, QBCore and ESX included

- ✅ Crack light color and volume in the config

- ✅ Custom notify support with one function

- ✅ No database, no dependencies, no shop

- ✅ Config checked at start with clear console warnings

- ✅ Exploit-safe, server-authoritative

- ✅ 0.00ms idle, nothing runs until an item is used


---


## Installation


1. Get the package and drop `risk-fortunecookie` into your resources folder

2. Add `ensure risk-fortunecookie` to your `server.cfg`

3. Add the item to your inventory with the file from the `_items` folder (`ox_inventory`, QBCore or ESX SQL)

4. Give yourself a `fortune_cookie`, use it and click the cookie


**Requirements:** ESX, QBCore or QBox. No database, no `ox_lib`.


---


## FAQ


**What is Risk Fortune Cookie?**

A FiveM fortune cookie script for ESX, QBCore and QBox. Players use the item, click a cookie that cracks in two with sound and crumbs, and read the fortune on the paper inside.


**Is Risk Fortune Cookie free?**

Yes. The escrow version is free, with every feature and no subscription. The open source version with the full code is a paid package.


**Does it work with ox_inventory?**

Yes. `ox_inventory`, `qb-inventory`, `qs-inventory`, `codem-inventory`, `origen_inventory` and the native ESX, QBCore and QBox inventory are detected automatically. The item file for `ox_inventory` is included.


**Does it work with Quasar (qs-inventory)?**

Yes. `qs-inventory` is detected automatically for counting, taking and giving the item and for using it. An item line for it is in the `_items` folder.


**Is it a shop or a job?**

No. It is an item. Sell it in any shop, give it as a reward or hand it out from a restaurant, event or quest script.


**Can I add my own fortunes?**

Yes. Open `config/fortunes.lua` and add one line per fortune, in any language. The file is not escrowed.


**Can players eat the fortune cookie?**

Yes. After the paper is closed the character plays the eating animation and gets hunger back on ESX (`esx_status`), QBCore and QBox. Set the percent or turn it off in the config.


**Can the cookie give money or items?**

Yes, optionally. Set a chance, pick money to cash or bank, or an item, and give each entry an amount range and a weight.


**Can another script open a cookie?**

Yes. `exports['risk-fortunecookie']:OpenFortuneCookie(source)` opens one without the item.


**Does it need a database, ox_lib or a target script?**

No. There is no database and no dependency. `ox_target` and `qb-target` are not needed.


**Does it cost performance?**

No. The script runs at 0.00ms while idle and nothing runs until an item is used. The screen only animates while it is open.


---

https://youtu.be/6UQ1HFPsecE

Specifications
Technical specifications for FORTUNE COOKIE
Resource FORTUNE COOKIE
Frameworks ESX, QBCore and QBox
Price 14.99 EUR, one-time
Licensing Open source - full Lua included
Idle performance 0.00ms
Updates Free lifetime updates
Support 24/7 via the Risk Scripts Discord
Documentation Risk Scripts GitBook
Frequently asked questions
Does FORTUNE COOKIE work with ESX, QBCore and QBox?
FORTUNE COOKIE is compatible with ESX, QBCore and QBox. The framework is detected at runtime, so the same download works on every supported server without a separate build.
Is FORTUNE COOKIE open source or Escrow?
This edition of FORTUNE COOKIE is fully open source, so the complete Lua is included and can be read, audited and extended.
How much does FORTUNE COOKIE cost?
FORTUNE COOKIE costs 14.99 EUR as a one-time purchase. It is also included in the Risk Scripts VIP package, a one-time payment that covers the Escrow edition of every current and future release.
Does FORTUNE COOKIE affect server performance?
FORTUNE COOKIE idles at 0.00ms and is profiled under real server load, so it runs alongside a full resource stack without measurable frame cost.
What support and updates are included with FORTUNE COOKIE ?
Every Risk Scripts purchase includes free lifetime updates and 24/7 support through the Risk Scripts Discord, answered directly by the developers who wrote the code.

Saved Items (0)

You haven't saved any items yet.