Commands#
| Command | Where | Description |
|---|---|---|
/businesstablet |
Player | Opens and closes the standalone tablet. The name comes from Config.UI.Command. |
clearbusinesstabletdata <businessId> |
Server console only | Deletes a business's transactions, staff, blacklist, announcements, menu, logs, memberships and settings. It cannot be undone. |
Server exports#
Each export has an example of it in use on Examples.
| Export | Description |
|---|---|
RegisterBusiness(businessId, data) |
Adds a business to the tablet. Returns true, or false and a reason. See Registering a business. |
UnregisterBusiness(businessId) |
Removes a business your resource registered. |
GetBusinesses() |
The registered businesses. |
IsFeatureEnabled(businessId, name) |
Whether a feature ('loyalty', 'memberships' or 'ordering') is on for a business. |
HasPermission(source, businessId, permissionKey) |
Whether a player may do something at a business. |
AddOrderTransaction(source, businessId, orderData) |
Logs a sale and credits commission. Returns success, orderNumber, commission. |
NextOrderNumber(businessId) |
Takes the next order number, so your tills and the tablet never repeat one. |
GetMemberDiscount(businessId, citizenid) |
The best membership discount (percent) a customer has, and the tier name. |
GetCommissionRate(businessId, citizenid) |
The commission percent of a citizen's rank, or nil when they do not hold the job. |
GetBlacklistEntry(businessId, name) |
The active blacklist entry for a character name, or nil. |
GetMenu(businessId) |
The business's menu items. |
CheckLoyaltyCode(businessId, code, src) |
Looks up a loyalty card by its code. Returns card, err. Lookups are rate limited per player. |
GetLoyaltyCardOf(businessId, citizenid) |
A customer's own card at a business, or nil. |
RedeemLoyaltyCode(businessId, code, staffCitizenid, customerCitizenid) |
Redeems a card's reward. Returns card, err. |
GiveApplicationForm(source, businessId, count) |
Gives a player blank application forms for a business. Returns true, or false and a reason. |
PushExtension(businessId, page) |
Tells open tablets to reload one of the business's own pages. |
AddOrderTransaction orderData fields:
| Field | Description |
|---|---|
price |
Total charged. |
description |
What was sold. |
cashierId |
Citizen ID of who rang it up, 'kiosk' for a self-serve kiosk or 'vending' for a vending machine. |
recipientId |
Optional. The customer's citizen ID. |
source |
Optional. Where it was placed, such as 'Till 2' or 'Phone'. Shown in the customer's past orders. |
appCustomer |
Optional. Citizen ID whose phone app lists the order. |
orderNumber |
Optional. A number from NextOrderNumber already shown to the customer. |
gst |
Optional. Tax included in the price. Commission is worked out on the price less this. |
splitOnDuty |
Optional. Splits the sale between everyone on duty, each earning commission on their share. |
splitFull |
Optional. With splitOnDuty, pays out the whole sale instead of commission. |
commissionPaid |
Optional. Your script paid staff itself. The tablet credits no commission and shows this amount. |
commissionOwed |
Optional. Your script worked out the commission. The cashier is owed this instead of their rank's rate. |
commissionSplit |
Optional. { { citizenid, owed, share }, ... } when several staff worked the sale. |
loyaltyCard |
Optional. The card holder's citizen ID, to earn a stamp. |
Server event#
glitch-businesstablet:updateStaffPay (businessId, identifier, payAmount) updates open tablets after another resource changed an employee's pay. It is a server-only event, not a net event.
Client exports#
| Export | Description |
|---|---|
OpenTablet() |
Opens the standalone tablet for the player's business. Also used as the tablet item's client export. |
CloseTablet() |
Closes the standalone tablet. |
Exports your business resource provides#
| Export | When |
|---|---|
BusinessTabletCall(source, businessId, page, action, data) |
Your business adds its own pages. See Custom pages. |
PhoneOrder(src, picked, useCard), PhoneOrders(src), PhoneOrdersOpen() |
Your business turns on features.ordering. PhoneOrderLimits() is optional. |
Stuck on a step?Ask in the Discord →