Skip to content
lsl.devlsl.devLSL Dev

Money

Objects can receive L$ from avatars and, with the owner’s permission, pay L$ out. Vendors, tip jars, rentals and games are built from these few functions.

Receiving needs no permission: the money event fires when someone pays the object. Paying out needs PERMISSION_DEBIT, granted by the owner. Handle it carefully, because a bug can spend the owner’s money.

Concepts

Functions and events

eventmoney(key id, integer amount)
voidllSetPayPrice(integer price, list quick_pay_buttons)
keyllTransferLindenDollars(key destination, integer amount)
eventtransaction_result(key id, integer success, string data)
integerllGiveMoney(key destination, integer amount)
voidllGiveInventory(key target, string item)

Money on the wiki

The wiki’s category of money functions and events.

Scripting Details

eventmoney(key id, integer amount)
Triggered when a resident specified by id pays an amount of Linden dollars (L$) to the prim.
voidllSetPayPrice(integer price, list quick_pay_buttons)
Suggests default amounts for the pay text input field price and the four payment dialog quick_pay_buttons when an avatar pays this object.
voidllSetClickAction(integer action)
Sets the action (a CLICK_ACTION_* flag) performed when an avatar left-clicks the prim.
integerCLICK_ACTION_PAY = 3
Opens the pay dialog when the prim is clicked or touched.
voidllRequestPermissions(key agent, integer permissions)
Requests permissions (a bitfield specified by permissions) from the agent in the same region, calling run_time_permissions if granted. This call does not pause script execution.
integerPERMISSION_DEBIT = 0x00002
Runtime permission that allows the script to successfully call llGiveMoney or llTransferLindenDollars to debit the owner's account.
keyllTransferLindenDollars(key destination, integer amount)
Transfers amount of L$ from the script owner to the destination avatar, requiring the PERMISSION_DEBIT permission. Returns a key query handle matching the resulting transaction_result event.
eventtransaction_result(key id, integer success, string data)
Triggered when an asynchronous L$ transfer (such as llTransferLindenDollars) is completed. Passes transaction info id, success status, and CSV or error data.
integerllGiveMoney(key destination, integer amount)
Transfers the specified amount of L$ from the script owner to the destination avatar. Silently fails if the PERMISSION_DEBIT permission has not been granted. Returns 0 (use llTransferLindenDollars to match transactions to transaction_result events).
voidllGiveInventory(key target, string item)
Gives the specified inventory item to the target, as permitted by the permissions system. The target can be any agent or an object located in the same region.
integerllGiveAgentInventory(key agent, string folder, list items, list options)
Gives the specified inventory items to the agent as a new folder named folder, as permitted by the permissions system. Customizes the transfer using options.
keyllRequestAgentData(key id, integer data)
Asynchronously requests the specified data category (DATA_*) about the agent id. Triggers a dataserver event with the results and returns a key query handle.

Additional

Constant groups PayButton 2

Constant groups TransferError 8

See also Category MoneySL Wiki LSL MoneyFeature AvatarsFeature Parcels & RegionsSL Wiki Script library: moneyPlanned Recipe: vendor with refunds