Scratch Ticket v3: installation and configuration
Install the Scratch Ticket v3 script on your FiveM server: prerequisites, ox_inventory / QBCore / ESX items, ticket and prize configuration, admin commands.
The Ticket à gratter script lets your players buy tickets at the tobacconist, scratch them box by box and try for the server jackpot. Version 3 brings a new "Point de vente" interface, realistic scratching with effects and sounds, a live jackpot and per-player statistics. The grid and the prize are always decided by the server.
Prerequisites
- ESX Legacy or QBCore
- oxmysql
- Optional: ox_inventory, ox_target or qb-target (detected automatically)
- The Cfx.re account that received the asset must be the one tied to the server's license key (sv_licenseKey)
1. Get the product
After purchase, the product is delivered automatically to the Cfx.re account used for payment. Open the Cfx.re portal (Granted Assets), find the product and download the archive. If you had an older version, download it again: v3 completely replaces the old one.
2. Install
- Place the script folder in resources (keep its name).
- No SQL query to import: the tables are all created automatically on first start.
- Add ensure followed by the folder name in server.cfg, after your framework, oxmysql and your inventory.
- Restart the server.
3. Add the items
The item files are provided, ready to paste, along with the images of the 4 tickets:
- ox_inventory: add the items to the data/items.lua file and copy the images into web/images.
- QBCore: add the items to qb-core/shared/items.lua and the images to your inventory's image folder.
- ESX: add the items to your database (items table) or to your inventory, with the images.
On startup, the script checks that each item exists and displays a clear message in the console if one is missing.
4. Configure
- Tickets: add as many tickets as you want, with their price and maximum prize.
- Prizes: money, bank, items, weapons, free ticket or jackpot.
- Economy: the payout rate of each ticket is displayed in the console, to keep the economy healthy.
- Discord logs: webhook to be set server-side only.
- Language: French and English included.
5. Commands and exports
- /giveticket: give tickets to a player.
- /setjackpot: set the jackpot amount.
- Exports are available for your other scripts (see the delivered documentation).
On the player side: purchase in cash or by card at the point of sale, scratching with mouse or touch, "Reveal all" and "Next ticket" buttons. The prize is always credited, even after a crash or disconnection.
6. Troubleshooting
- "Missing item" message in the console: the item was not added to your inventory, repeat step 3.
- Startup error: check the order of the ensure lines (framework, oxmysql and inventory first) and the server's Cfx.re license.
- Ticket images missing: copy the provided images into your inventory's image folder.