Where Players Meet It#
Lottery Creator has four touch points, and it helps to know which is which from the start:
Where | Opened with | What it is for |
|---|---|---|
The creator |
| Admins and creator jobs: placing, editing, teleporting to and deleting machines. |
The machine | Target, or | Everyone: buying tickets, buying a machine that is for sale, managing a machine you own. |
The scratchcard | Using the item | Everyone: the card on screen, scratched with the mouse. |
The phone | The Lottery app | Quasar Smartphone users: buying and scratching tickets from anywhere. |
Placing a Machine#
/lotterycreator opens the creator. On the left is every machine on the server — a search box, a Blip badge on the ones that have one, and each one's price and account. Create Vendor starts a new machine; picking one from the list opens it for editing.
The form#
Section | What you set there |
|---|---|
Vendor Settings | The label players see on the target, the prop, the payment account (cash, bank or black money), the scratch item it hands out and the ticket price. |
Placement | Where the machine stands and which way it faces, set in the world. |
Blip Settings | An optional map blip: its name, sprite, colour, scale (0.2 to 1) and position. Sprites and colours are picked from searchable lists with pictures. |
Access Control | The jobs — and, per job, the grades — that may use the machine. Nothing selected means everyone. |
Ownership | For sale and the purchase price. Shown only while player-owned machines are enabled. |
Setting the position#
Press Select under Vendor Position. The window closes and a see-through copy of the chosen prop follows wherever you look, with a red marker and a line from your character to it. You keep walking and turning the camera as usual; the point lands on whatever you are looking at, up to 50 metres away.
Key | Does |
|---|---|
| Place the machine here. |
| Turn it slowly, for fine alignment against a wall. |
| Turn it 15° per notch. |
The creator reopens with the position and heading filled in. Press Save and the machine spawns for every player at once — no restart. A model the game cannot find is refused before the preview starts, with Model … is not valid.
Managing machines#
Action | How |
|---|---|
Edit | Pick it in the list, change the form and Save. The machine respawns for everyone; its owner, earnings and stock are kept. |
Teleport | The teleport button on its card puts you beside it, to check it in person. |
Delete | The delete button, then confirm. The machine disappears for everyone and its row is removed — owner, earnings and stock with it, and nothing is refunded. |
Props#
The prop list is Config.VendorProps. It ships with the lottery machine streamed by lottery_machine and two GTA vending machines; any spawnable model can be added, your own included:
Config.VendorProps = {
{ label = 'Lottery Machine', value = 'lotrrery_vending_machine' },
{ label = 'Vending Soda', value = 'prop_vend_soda_01' },
{ label = 'Vending Snack', value = 'prop_vend_snak_01' },
-- { label = 'My machine', value = 'my_custom_prop' },
}Every machine is spawned on each client frozen in place and indestructible, so it cannot be pushed, moved or blown up.
Buying a Ticket#
At a machine, the target offers Buy <name> - $<price>; without a target, walk up and press E. The character makes a short hand-over gesture, the price is taken from the machine's payment account, and a scratchcard lands in the inventory. The server checks that the player can pay before anything changes hands.
What a machine sells depends on its state:
State | Tickets | Notes |
|---|---|---|
Server machine — no owner, not for sale | Sold | Unlimited tickets. The money leaves the economy. |
For sale — no owner, listed | Not sold | Not in service: the only option is Buy machine. |
Owned, with stock | Sold | Each ticket uses one unit of stock and pays the owner. |
Owned, empty | Not sold | The ticket option disappears until the owner restocks. |
A machine restricted to jobs shows its ticket option only to players with an allowed job and grade. With player ownership turned off, every machine is a server machine.
Scratching a Card#
Using the scratchcard from the inventory opens the card. The character holds a lottery ticket with a clipboard animation, and the mouse becomes a coin: hold the button and drag to scratch. The six squares are drawn on the server the moment the card is used, and the ticket is consumed — what is under the foil is decided before the first scratch.
Clear about a quarter of the card and the rest reveals itself, with the prizes lighting up.
Claim prize pays the total. Close on a winning card claims it too, so a prize is never lost by closing.
A losing card only offers Close, with Better luck next time!
The Prize Table#
What a card can pay is one list, Config.PossibleRewards:
Config.PossibleRewards = {
{ label = 'NO WIN', type = 'none', amount = 0, chance = 80 },
{ label = '$10', type = 'money', amount = 10, chance = 5 },
{ label = '$50', type = 'money', amount = 50, chance = 3 },
{ label = '$150', type = 'money', amount = 150, chance = 1 },
{ label = '$250', type = 'money', amount = 250, chance = 0.5 },
{ label = '$1,000', type = 'money', amount = 1000, chance = 0.2 },
}Field | Meaning |
|---|---|
| What is printed on the square. Keep it in step with |
|
|
| What the square pays, in cash. |
| Its weight. Weights are compared with each other, so they do not have to add up to 100 — the shipped ones add up to 89.7. Decimals are fine. |
How a card is drawn#
Each of the six squares rolls on its own against the table, and the card pays the total of every winning square: three $10 squares pay $30, a $10 and a $1,000 pay $1,010. The odds of one square landing on a reward are its chance divided by the sum of all chances.
Balancing it#
The average a card pays out is:
average per card = 6 × Σ(amount × chance) ÷ Σ(chance)With the shipped table that is 6 × 675 ÷ 89.7 ≈ $45 a card, against a $30 ticket. About half of all cards win something, and on average players take out more than they put in. To turn the lottery into a money sink, raise the NO WIN weight or lower the prizes — raising NO WIN from 80 to 150 alone brings the average down to about $25 a card.
Owned machines do not change this maths. The owner earns from the ticket price and the prizes are paid by the system on top, so a generous table costs your economy, never the owner.
Player-Owned Machines#
With Config.Ownership.enabled, a machine can be bought and run by a player, like a vending-machine business: they set the price, keep it stocked and collect what it earns.
Putting a machine up for sale#
Tick For sale in the creator's Ownership section and set its purchase price — 25,000 by default. While it is listed and unowned, the machine sells no tickets: players walking up see Buy machine - $25000.
Buying one#
The purchase screen shows the price, the account it is paid from (bank by default), the current ticket price and how much of every ticket the owner keeps. A player may own up to Config.Ownership.maxPerPlayer machines — two by default, 0 for unlimited.
A bought machine starts empty: it sells nothing until its new owner loads ticket stock.
Running it#
The owner walks up and picks Manage machine — on the target, or G beside the ticket prompt (E when it is the only option).
Section | What it does |
|---|---|
Ticket price | What a ticket costs, inside |
Ticket stock | Tickets loaded, out of |
Available earnings | What sales have earned since the last collection. Collect pays it into the owner's account. |
Figures | Tickets sold, total revenue before commission, and the commission rate. |
Sell machine | Sells it back for |
Only the owner can collect, restock or sell. Earnings, stock and figures are written to the database as they change, so they survive a restart.
Where the money goes#
On every ticket | Amount |
|---|---|
The customer pays | The ticket price, from the machine's payment account. |
The owner earns | The price minus the commission, rounded down — $27 of a $30 ticket at the default 10%. |
The server keeps | The commission. |
The prizes | Paid by the system — never out of the owner's earnings. |
With the defaults, a $30 ticket earns the owner $27 and costs them $5 of stock: $22 a ticket.
Admin controls#
A framework admin who opens Manage machine on an owned machine also sees an Admin section, and can change its ticket price:
Control | What it does |
|---|---|
Listed for sale · Purchase price | The machine's sale settings, the same ones the creator edits. |
Evict owner | Removes the owner. Uncollected earnings and loaded stock are cleared without a refund. The machine goes back on sale only if |
Turning it off#
Config.Ownership.enabled = false makes every machine a fixed-price server machine: no Buy or Manage option, and no Ownership section in the creator. Owners, earnings and stock stay in the database untouched, and come back if you turn it on again.
The Phone App#
With Quasar Smartphone, players get a Lottery app, switched by Config.Phone.enabled. It reads the lottery live from the server:
Part | What it shows or does |
|---|---|
Wallet | The scratchcards you carry, the ticket price, and your cash and bank balances. |
Buy | One or several tickets without visiting a machine, when |
Scratch | Use a ticket on the phone; the prize is paid in cash, as at a machine. A card left half-scratched is waiting when the app is reopened. |
Prizes | The prize table with every chance. |
Recent winners | The last ten wins on the server, at machines and on phones. |
History | Your last 50 phone cards, with your total won and spent. |
Jackpot | A community figure that grows by 10% of every phone purchase. It is shown in the app; the script does not pay it out. |
The Settings#
Every option in config/main.lua. Machines themselves are edited in game; these are read when the resource starts, so restart it after a change.
Setting | Default | What it does |
|---|---|---|
|
| The language file from |
| en-US · USD · 0 decimals | How amounts are formatted in the interface: number format, currency and decimals. |
| police, ambulance | Jobs that may open the creator. |
| Cash · Bank · Black Money | The payment accounts offered in the creator. Each |
| 15 | How many machines are sent to a joining player per network message. Lower it on very large servers. |
| $30 · money · scratchcard | The values a new machine starts with, and the price, account and item of phone purchases. Its |
| 3 models | The creator's prop list. |
| on | Player-owned machines — see the next table. |
| auto |
|
| 2.0 | Range, in metres, of the target options and the prompts. |
| 6 rewards | The prize table. |
| on · remote purchase on |
|
| — | The creator's key hints and camera-tool speeds. Placement itself uses left click, |
|
| Extra console output. |
|
| Mutes the interface's game sounds. The coin-scratch sound of the card still plays. |
| off | Present in the file but not used by this version. |
Config.Ownership#
Key | Default | What it does |
|---|---|---|
|
| The master switch. |
|
| Pays for a machine and for restocks, and receives collected earnings and resale refunds. |
|
| Whether a machine saved without sale settings is listed, and whether an evicted machine goes back on sale. |
| 25000 | Purchase price of a new machine; editable per machine. |
| 2 | Machines one player may own. |
| 0.10 | The server's cut of every ticket, from 0 to 1. |
|
| Whether owners can sell their machine back. |
| 0.5 | Share of the purchase price refunded on resale, from 0 to 1. |
| 5 – 1000 | Lowest and highest ticket price an owner may set. |
| 500 | Most tickets a machine can hold. |
| 5 | What the owner pays per ticket loaded. |



