RED Lottery

TEBEX : RedStudioScripts · RED LOTTERY
ViDEO : HERE
DISCORD : HERE

RedStudio - red-lottery

red-lottery is a VORP lottery script for RedM with:

  • 50-number pool

  • 6-number ticket selection

  • hourly automated draws

  • unique draw codes

  • NUI with countdown, promo banner, and last draw display

Main Features

  • Buy tickets from lottery NPC(s)

  • Select exactly 6 unique numbers from 1..50

  • Hourly draw generation with offline catch-up

  • Draw announce in chat + console

  • Unique draw code format: RL-YYYYMMDD-HHMM

  • NUI includes:

  • countdown to next draw

  • promo message strip (configurable)

  • Last Draw block (code + extracted numbers)

  • Check Tickets button

  • Tickets are inventory items (lotteryticket) with metadata

  • Ticket item DB entry can be auto-created/updated (weight included)

  • Verify via item use or NUI button

  • Verified tickets are consumed by default

Dependencies

  • vorp_core

  • vorp_inventory

  • oxmysql

Installation

  1. Place folder in:
  • resources/[redstudio]/red-lottery
  1. Ensure dependency order in server.cfg (dependencies first):

ensure vorp_core

ensure vorp_inventory

ensure oxmysql

ensure red-lottery

  1. Restart resource or server:

restart red-lottery

Database

Tables are auto-created on resource start:

  • red_lottery_draws

  • red_lottery_tickets

The script also auto-checks schema and upgrades draw_date to DATETIME if needed.

Manual SQL files:

  • sql/install.sql

  • sql/items.sql

Player Flow

  1. Go to lottery vendor.

  2. Open menu and choose 6 numbers.

  3. Buy ticket.

  4. Wait for draw.

  5. Verify ticket using:

  • inventory item (lotteryticket), or

  • NUI Check Tickets button.

Default behavior:

  • consumeTicketOnVerify = true → ticket is removed after valid verification (draw exists).

  • With current defaults, winning ticket verification also pays automatically.

Configuration

Everything is in config.lua.

Important blocks:

  • Config.Starts / Config.Start: vendor locations

  • Config.Lottery:

  • poolSize (50)

  • numbersPerTicket (6)

  • ticketPrice

  • drawIntervalSeconds (3600)

  • consumeTicketOnVerify

  • autoClaimOnUse

  • announceDrawInChat

  • payoutByMatches

  • Config.Database:

  • itemName

  • itemWeight

  • ensureItemInDb

  • Config.Security:

  • anti-spam + vendor distance validation

  • Config.Admin:

  • ace permission for admin commands

  • Config.Locale.ui.promoLines:

  • promo lines with placeholders:

  • {maxPayout}

  • {ticketPrice}

  • {numbersPerTicket}

Admin Commands

  • redlottery_drawinfo

  • current draw status, next draw, pending count

  • redlottery_drawnow

  • forces current draw and resolves pending rows

ACE example:


add_ace group.admin redstudio.lottery allow

Notes

  • Last draw data shown in NUI is the most recent completed draw from DB.

  • Draw code is also stored in ticket metadata.

  • Keep config.lua public if you encrypt server/client Lua files.

Checklist

  • [ X] I have reviewed the latest version of the Releases rules.
  • [X ] I have included a detailed description of my work as described in the rules.
  • [X ] I have included a download link or a store link.
  • [ X] I have filled out the required information at the end of the topic

If you’re selling your resource, please include the following information at the end of your post:

Code is accessible No
Subscription-based No
Lines (approximately) 3000
Requirements vorp
Support Yes
Assets are accessible Yes/No
Subscription-based Yes/No
Polygons (model and LOD) Number of polys
Texture size and amount Number
Requirements & dependencies Requirements
Support Yes/No
Code is accessible No
Subscription-based No
MLO Yes/No
Number of rooms Number of rooms
Number of entities Number of entities
Requirements & dependencies Requirements
Support Yes/No

no link to tebex?

1 Like

RedStudioScripts · RED LOTTERY