Commands#
Claw Machine registers two admin commands that are always available, and a set of calibration commands that only exist while Config.Debug.enabled = true. Players need no command at all — everything they do starts at the cabinet with E or G.
Command | Who | Description |
|---|---|---|
| ace | Opens the creator: place, edit, restock, teleport to, delete and put machines up for sale. Renamed with |
| ace | Run at a cabinet: releases it from its owner, empties the till and puts it back up for sale. |
Calibration commands#
Used to fit your own cabinet model (see Adding Your Own Cabinet). Each works on the nearest machine within 15 m, and the ones that edit a value print a paste-ready block to the F8 console. Every name can be changed in Config.Debug.
Command | What it does |
|---|---|
| Marks the glass box and derives the rest of the machine from it. Start here. |
| Sets |
| Marks the hole where a prize counts as won. |
| Calibrates |
| Raises or lowers the whole interior at once. |
| Places the play camera while you look through it. |
| Places the player and their hand on the joystick. |
| Places every prize by hand. |
| Re-deals the prizes of the nearest machine. Needs the creator ace. |
| Previews the win or miss animation at a cabinet. |
| Prints the nearest machine's current configuration. |
| Plays an animation on your ped to try an idle pose. Without arguments it stops. |
| Server console (or creator ace): lists every machine with its cabinet, price, prizes stocked and whether someone is playing it. |
Server Exports#
For reading the machines from another resource — a phone app, a map, a Discord bot — or restocking one from an event. A machine's id is built from its position, in the form '-16521:-10603'; read it from GetMachines.
GetMachines
Every loaded machine — placed with the creator, hardcoded in Config.Machines, or managed by an arcade — keyed by id.
local machines = exports['qs-clawmachine']:GetMachines()
for id, m in pairs(machines) do
print(id, m.label, m.machineModel, m.price, m.paymentMethod)
end
-- each entry:
-- {
-- id, coords = { x, y, z }, heading, label,
-- machineModel, -- 'claw_01' ... 'claw_04'
-- price, paymentMethod, -- 'money' or 'bank'
-- prizeModels, -- { 'gacha_green', 'plush_01', ... }
-- prizeRewards, -- per-machine reward overrides
-- owned, ownerName, forSale, purchasePrice,
-- managed, -- resource name if an arcade owns it, else nil
-- }GetMachinePrizes
What is inside one machine right now, with each prize's resting position as a local offset from the cabinet.
local prizes = exports['qs-clawmachine']:GetMachinePrizes(machineId)
print(('%d prizes left'):format(#prizes))
-- each entry: { slot, key = 'gacha_red', model = 'gacha_balls_red', x, y, z, rx, ry, rz }RestockMachine
Refills a machine now with a fresh pile of its configured prizes — free, whoever owns it. Returns true, or false if the id does not exist.
-- e.g. a weekly event that refills every machine
for id in pairs(exports['qs-clawmachine']:GetMachines()) do
exports['qs-clawmachine']:RestockMachine(id)
endGetLeaderboard
The top players by prizes won. limit defaults to Config.Leaderboard.topLimit.
local top = exports['qs-clawmachine']:GetLeaderboard(5)
for rank, row in ipairs(top) do
print(rank, row.name, row.prizes_won, row.plays)
end
CreateManagedMachine,RemoveManagedMachine,SetManagedVisibleandGetManagedMachinesalso exist, but onlyqs-arcadesmay call them — any other resource getsnot_allowed. They are how Arcade Creator places its cabinets.
Rewards From Your Own Code#
Every prize a player wins goes through one open function, GivePrizeReward(src, prize, reward) in custom/server.lua. It is the place to hook anything that should happen on a win — a log, an achievement, a Discord message:
-- custom/server.lua
function GivePrizeReward(src, prize, reward)
-- prize: the catalog entry (prize.id, prize.label, prize.model, prize.grip)
-- reward: { money = 160, items = { { name = 'peluche_01', amount = 1 } } }
-- already resolved: the machine's override, else the catalog's reward
...
endAbout the Errors#
Every server answer that can refuse returns a locale key rather than a sentence — notify.busy, notify.own_limit — so the player reads it in their own language. The full list and what each one means is in Common Errors.



