For the complete documentation index, see llms.txt. This page is also available as Markdown.

Client Exports

getOwnedMachines

Returns all vending machines the player owns or works at.

Usage

local machines = exports['17mov_VendingMachines']:getOwnedMachines()

Returns

An array of machines:

Field
Type
Description

id

number

Machine ID

coords

table

Machine coordinates

balance

number

Current machine balance

stock.used

number

Currently used stock space

stock.total

number

Total stock capacity

label

string?

Custom machine label

role

string

Player's role for this machine

permissions

table

Player's permissions for this machine

street

string

Street name resolved from the machine location

Example

local machines = exports['17mov_VendingMachines']:getOwnedMachines()

for _, machine in ipairs(machines) do
    print(machine.id, machine.label, machine.balance)
end

getMapMachines

Returns a lighter version of the player's machines intended for map integrations.

Unlike getOwnedMachines, this does not include labels or detailed permissions.

Usage

Returns

An array of machines:

Field
Type
Description

id

number

Machine ID

role

string

Player's role for this machine

balance

number

Current machine balance

stock

table

Current stock information

location.coords

table

Machine coordinates

Example


Sales & History

getSales

Returns revenue statistics from the last 7 days across all machines the player owns.

The entries are returned from the oldest day to the newest.

Usage

Returns

Field
Type
Description

date

string

Date of the entry

count

number

Number of purchases

revenue

number

Revenue generated that day

Example


getHistory

Returns purchase history for the player's vending machines.

Each call returns up to 25 purchases, newest first.

Usage

Parameters

Parameter
Type
Required
Description

machineId

number

Machine to filter by. Leave empty to include all owned machines

before

number

ID of the last purchase from the previous page, used for pagination

Returns

Field
Type
Description

id

number

Purchase ID

machine_id

number

Machine ID

buyer_name

string

Buyer name

item_name

string

Inventory item name

item_label

string

Display label of the item

price

number

Purchase price

created_at

number

Purchase timestamp

Example

Pagination

Pass the ID of the last entry from the previous page:


Machine Settings

getMachineSettings

Returns editable settings for a machine.

This returns nil if the player is not the owner.

Usage

Parameters

Parameter
Type
Required
Description

machineId

number

Machine ID

Returns

Field
Type
Description

label

string?

Custom machine label

lowStockThreshold

number

Low-stock notification threshold

Or nil if the player does not own the machine.

Example


saveMachineSettings

Updates the machine label and low-stock threshold.

Usage

Parameters

Parameter
Type
Required
Description

machineId

number

Machine ID

label

string?

New machine label

lowStockThreshold

number

New low-stock threshold

Returns

Field
Type
Description

success

boolean

Whether the settings were saved

message

string?

Optional response message

label

string?

Saved machine label

lowStockThreshold

number?

Saved low-stock threshold

Example


Notifications

getNotifications

Returns the player's current notification preferences.

Usage

Returns

Field
Type
Description

lowStock

boolean

Low-stock notifications

sales

boolean

Sales notifications

deliveries

boolean

Delivery notifications

Example


saveNotifications

Updates the player's notification preferences.

You only need to provide the options you want to change.

Usage

Parameters

Field
Type
Required
Description

lowStock

boolean?

Enable or disable low-stock notifications

sales

boolean?

Enable or disable sales notifications

deliveries

boolean?

Enable or disable delivery notifications

Returns

Field
Type
Description

success

boolean

Whether the preferences were saved

message

string?

Optional response message

notifications

table?

Updated notification preferences


Workers

getWorkers

Returns all workers assigned to a machine.

Usage

Parameters

Parameter
Type
Required
Description

machineId

number

Machine ID

Returns

Field
Type
Description

identifier

string

Worker identifier

name

string

Worker name

permissions

table<string, boolean>

Worker permissions

Example


addWorker

Adds an online player as a worker.

The player specified by targetId must currently be online.

Usage

Parameters

Parameter
Type
Required
Description

machineId

number

Machine ID

targetId

number

Server ID of the player to hire

permissions

table<string, boolean>

Worker permissions

Available permissions:

Permission
Description

restock

Restock the machine

order

Place wholesaler orders

collect

Collect machine revenue

workers

Manage workers

Returns

Field
Type
Description

success

boolean

Whether the worker was added

message

string?

Optional response message

employees

table[]?

Updated worker list

Example


setWorkerPermissions

Updates permissions for an existing worker.

Use the identifier returned by getWorkers().

Usage

Parameters

Parameter
Type
Required
Description

machineId

number

Machine ID

identifier

string

Worker identifier returned by getWorkers()

permissions

table<string, boolean>

New permission set

Returns

Field
Type
Description

success

boolean

Whether the permissions were updated

message

string?

Optional response message

employees

table[]?

Updated worker list

Example


removeWorker

Removes a worker from a machine.

Usage

Parameters

Parameter
Type
Required
Description

machineId

number

Machine ID

identifier

string

Worker identifier

Returns

Field
Type
Description

success

boolean

Whether the worker was removed

message

string?

Optional response message

employees

table[]?

Updated worker list


Wholesaler

getWholesalerCatalog

Returns all products currently available from the wholesaler.

Products are returned with their inventory label and image.

Usage

Returns

Field
Type
Description

item

string

Inventory item name

label

string

Display label

price

number

Wholesaler price

image

string?

Item image

Example


getWholesalerOrders

Returns wholesaler orders for a machine.

Usage

Parameters

Parameter
Type
Required
Description

machineId

number

Machine ID

Returns

Each order contains:

Field
Type
Description

id

number

Order ID

status

string

Current order status

items

table[]

Items included in the order

Each item contains:

Field
Type
Description

item_name

string

Inventory item name

item_label

string

Display label

quantity

number

Ordered quantity

remaining

number

Quantity still remaining

Example


getWholesalerCapacity

Returns how much of each product can still fit inside a machine.

The returned table is indexed by item name.

Usage

Parameters

Parameter
Type
Required
Description

machineId

number

Machine ID

Returns

For example:

Returns false if capacity could not be retrieved.

Example


placeWholesalerOrder

Places a wholesaler order and charges the configured account.

Usage

Parameters

Parameter
Type
Required
Description

machineId

number

Machine ID

cart

table[]

Products to order

Each cart entry must contain:

Field
Type
Description

item

string

Inventory item name

quantity

number

Quantity to order

Returns

Field
Type
Description

success

boolean

Whether the order was placed

message

string?

Optional response message

total

number?

Total order value

orders

table[]?

Updated order list

Example


Access

hasAccess

Returns whether the player owns or works at any vending machine.

This is useful when you only need a simple yes/no check before opening your own UI or integration.

Usage

Returns

Type
Description

boolean

true if the player owns or works at at least one vending machine

Example

Last updated