Scratchcard (LuckGame)
Scratchcard - professional ESX script with custom features and optimized performance for FiveM servers Compatible with ESX framework.
Video Preview
Click to load video from YouTube. By watching, you agree to their privacy policy.
Scratchcard (LuckGame) - Interactive Lottery System for FiveM Servers
Add an exciting gambling and entertainment dimension to your FiveM server with this fully configurable scratchcard system. Players can purchase lottery scratch tickets, reveal symbols, and win cash prizes based on matching combinations - just like real-world lottery scratchcards. Perfect for ESX servers and easily portable to other frameworks, this open-source script allows complete customization of prizes, symbols, currency, and odds to match your server's economy perfectly.
What This Scratchcard System Does
This script transforms the simple concept of lottery scratchcards into an interactive FiveM experience. Players buy scratchcards from designated locations or vendors, then use them to reveal hidden symbols. When matching symbols align, players win cash prizes that are automatically added to their account. The system handles everything from purchase transactions to prize payouts, creating a complete gambling mini-game that adds passive entertainment and economic circulation to your server.
Unlike basic command-based lottery systems, this provides a visual scratchcard experience. Players see the card, scratch to reveal symbols, and experience the anticipation of discovering whether they've won - creating genuine excitement and engagement. The configurable odds mean you control exactly how often players win and how much, ensuring the system enhances your economy rather than disrupting it.
Key Features
- Fully Configurable System - Customize currency type, prize amounts, symbols, and winning combinations
- ESX Framework Integration - Works seamlessly with ESX money system and item framework
- Easy Framework Porting - Clean code structure allows simple adaptation to QBCore, vRP, or standalone
- Open Source - Complete access to edit and customize all code to your needs
- Multiple Prize Tiers - Configure different winning amounts for various symbol combinations
- Visual Scratch Interaction - Interactive UI for revealing symbols (implementation varies by version)
- Economic Balance Controls - Set purchase prices and win rates to maintain server economy
- Purchase Locations - Define where players can buy scratchcards (shops, vendors, specific coordinates)
How Players Use Scratchcards
Purchase: Players visit configured locations (convenience stores, gas stations, designated vendors) and purchase scratchcards using in-game currency. The purchase price is deducted from their account automatically through ESX money functions.
Scratch: Once purchased, players activate the scratchcard item from their inventory. The card displays symbols or numbers (depending on configuration) that players reveal to determine if they've won.
Win: When winning combinations appear, the system instantly credits the prize amount to the player's account. Losing cards simply disappear, encouraging players to try again.
The entire process is smooth and automated - no admin intervention needed. Players can buy, scratch, and win independently, creating a self-sustaining entertainment option.
Perfect For These Server Types
- Economy-Focused Servers - Add money sinks and circulation to your server economy
- Civilian Roleplay - Provide legal gambling entertainment for non-criminal players
- Convenience Store Scripts - Integrate with shop systems as purchasable items
- Gas Station Roleplay - Add authentic lottery ticket sales to fuel stations
- Casino & Gaming Servers - Complement casino scripts with portable lottery options
- Passive Income Systems - Give players alternative ways to try winning money
- Realistic City RP - Mirror real-world lottery ticket availability
Configuration & Customization
The config.lua file provides extensive control over every aspect of the scratchcard system:
Currency Settings: Define what currency players use to purchase cards (cash, bank, black money, or custom currencies). Set the card purchase price to balance with your server's economy - whether that's $10 for low-economy servers or $500 for high-economy setups.
Symbol Configuration: Choose what symbols appear on cards. Use traditional lottery symbols (777, cherries, bars), numbers (1-9), letters, or custom icons. Define how many symbols must match to trigger wins.
Prize Amounts: Set exactly how much each winning combination pays out. Create multiple tiers - small wins for common combinations (2x purchase price), medium wins for rarer matches (10x), and jackpots for the rarest combinations (100x or more). Balance these against card cost and win probability to create sustainable economics.
Win Probability: Control the odds of winning. Make it rare for excitement, or more frequent for player retention. Adjust until the system generates desired player engagement without inflating economy.
Purchase Locations: Define coordinates where scratchcards can be purchased, or integrate with existing shop scripts. Add markers, blips, or NPC vendors for easy player access.
Installation Guide
- Download the scratchcard resource from your purchase confirmation email
- Extract the folder and place it in your server's
resourcesdirectory - Open
config.luaand configure all settings (currency, prices, symbols, prizes) - Test your configuration thoroughly to ensure economic balance
- Add
ensure scratchcardto yourserver.cfg - Restart your server and verify the script loads without errors
- Test purchasing and scratching cards to confirm functionality
Framework Compatibility
- ✅ ESX - Native support for all ESX versions, uses standard ESX money functions
- ✅ QBCore - Easily portable by replacing ESX money functions with QB equivalents
- ✅ vRP - Can be adapted to vRP money and inventory systems with basic Lua knowledge
- ✅ Standalone - Works as item-based system, adaptable to custom frameworks
- ✅ Custom Frameworks - Open source code allows modification for any framework
The open-source nature means developers can modify currency handling, inventory integration, and UI elements to match any framework structure. The core scratching logic remains universal.
Technical Specifications
- Performance: Lightweight script with minimal server impact (0.00ms when not in use)
- Database: Uses framework's existing player data, no additional tables required
- Code Structure: Clean, commented Lua code for easy understanding and modification
- Dependencies: ESX framework (or your chosen framework after porting)
- Client-Server: Proper client-server architecture prevents cheating
- Item Integration: Works with ESX items system for inventory management
Economic Impact & Balance
When configured properly, scratchcards serve as an economic tool that benefits your server. They act as a money sink - players spend currency on cards, and the house (server) keeps a percentage through controlled win rates. If you set cards at $100 with an average 70% payout rate, the server removes $30 from economy per card sold over time.
Simultaneously, scratchcards create excitement and hope. Players who win feel lucky and rewarded, while those who lose are tempted to try again. This psychological engagement keeps players active and interacting with your economy.
Balance considerations: Set jackpots high enough to be exciting but rare enough to not inflate economy. Configure small wins frequently to maintain player interest. Monitor your server's overall economy and adjust win rates if cards are removing too much (or too little) money from circulation.
Integration with Existing Systems
Shop Scripts: Add scratchcards as purchasable items in convenience store scripts, gas station systems, or general shops. Configure the script to check for purchases at these locations.
Inventory Systems: The scratchcard appears as an item in ESX inventory. Players can trade cards with each other, gift them, or save them for later - adding social and economic depth.
VIP/Membership Systems: Give VIP members better odds, cheaper card prices, or exclusive high-prize cards as a membership benefit.
Event Systems: Run promotional periods with increased jackpots, double-win-chance weekends, or special holiday-themed cards with unique symbols and prizes.
Roleplay & Gameplay Applications
Scratchcards add authentic civilian activity to your server. Players gather at convenience stores not just for robbery targets, but as social spaces where people try their luck. Gas stations become meeting points where players scratch cards while vehicles refuel. This creates organic player interaction around a simple, fun activity.
Criminal characters can sell hot scratchcards obtained through robberies. Shop owners can roleplay as lottery vendors, encouraging customers to try their luck. Winners celebrate in the streets, while habitual gamblers develop reputations. These small roleplay moments enrich your server's community.
What Makes This Scratchcard Script Stand Out
The combination of full configurability and open-source code provides unmatched flexibility. You're not locked into developer-defined prizes or odds - you control every aspect. The clean code structure means even novice developers can understand and modify the system, while experienced scripters can completely overhaul the UI and mechanics to create unique experiences.
Being designed for ESX with easy portability means it fits into most server ecosystems without conflicts. The lightweight performance ensures it won't impact server resources, even with hundreds of players scratching cards simultaneously.
Customization Examples
Server owners have created numerous variations: themed scratchcards for holidays (Christmas cards with special symbols), tiered card systems (bronze/silver/gold cards with increasing costs and prizes), progressive jackpots that grow until won, and linked lottery systems where card purchases contribute to a central pool. The possibilities are limited only by your Lua knowledge and creativity.
Requirements & Dependencies
- FiveM server (latest artifacts recommended)
- ESX framework (or willingness to port to your framework)
- Basic Lua knowledge for configuration (editing config.lua values)
- Optional: Existing shop script for integrated purchasing
- Optional: Custom UI framework if replacing default interface
Support & Community
As an open-source resource, the scratchcard script benefits from community contributions. Many server owners share their configurations, UI improvements, and framework ports. This collaborative environment means you can find examples, get help with porting, and discover creative implementations other servers have developed.





