Don't click here unless you want to be banned.

LSL Wiki : money

HomePage :: PageIndex :: RecentChanges :: RecentlyCommented :: UserSettings :: You are ec2-54-204-127-56.compute-1.amazonaws.com
money(key id, integer amount)

This event is triggered when the agent with the key id gives amount of Linden Dollars to the object.

The existence of a money event (even an empty one) in the current state enables the "Pay" entry in the PieMenu when right-clicking the object and allows users to pay the object's owner. Note that this gives you control of when the "Pay" entry is shown, by switching between states with and without a money event handler.

The amount is chosen via an input field by the giver, or by the amounts specified in the "Fast Pay" buttons (to customize the values of these, use llSetPayPrice).

If the object is deeded to a group, the group receives the money.

Example:
default {
    money(key giver, integer amount) {
        llSay(0, "Thanks for the " + (string)amount + "L$, " + llKey2Name(giver));
    }
}

For an additional example, see ExampleMoney.

Notes:

Q: Someone said they paid my object, but they didn't get anything. I see the transaction in my account's transaction history, though. What gives?
A: Under high database or sim load, there appears to be a bug where the money event is not triggered. The Lindens are aware of the problem, but there's not yet any word on a fix. In the meantime, it can help to add a list to your script containing a log of users (using llKey2Name) to pay your object money (from the script's perspective, at least, meaning the money event was triggered) and the time at which they paid. Then, if you receive a complaint, you can easily check against your log to see if the customer is telling the truth.

Q: Is there a way to find out when money is paid into a user's account?
A: No, the money() event can only be triggered when money is paid directly to the object containing the money() event. There is no way for an LSL script to check a user's money, nor be triggered when it changes.
In theory, one could run a script on an external server that parsed the contents of the SL Account page on the SL website, then coordinated payment data with scripts in SL. This would naturally depend on several factors, such as the rate at which the SL Account page is actually updated, the amount of transactions from different sources you're likely to have, and of course, how much the Lindens do or do not want your bot to hammer their server.

To give money via a script, use the llGiveMoney function.


Events | LindenDollar
There are 10 comments on this page. [Display comments/form]