Difference between revisions of "LlSetPayPrice"

From Second Life Wiki
Jump to: navigation, search
(already mentioned in money but debugging noses will sniff on this page too.)
Line 1: Line 1:

Revision as of 00:37, 31 August 2013


Function: llSetPayPrice( integer price, list quick_pay_buttons );

Suggest default amounts for the pay text field and pay buttons of the appearing dialog when someone chooses to pay this object.

• integer price PAY_* constant or positive value
• list quick_pay_buttons Four PAY_* constants and/or positive integer values
Constant Alt Description
Hides this quick pay button.
PAY_DEFAULT -2 Use the default value for this quick pay button.
Button Order
$1 $5
$10 $20


  • This function should not be trusted to limit the values of money payable to the object; always verify the amount paid is the amount expected.
  • Use only one call to this function in all the scripts on an object to prevent confusion about which values are used. You still need to check in the money event that the amount is as expected.
  • This function only works when called from the root prim of an object. Its effect applies to all the prims in the object. Calling it from a child prim has no effect.
  • Payment to a prim can be blocked by the llSetPayPrice() setting in the prim, which persists even if the script with llSetPayPrice() is removed.
  • Note that the pay option will only be shown in prims having a running script with a money event (or in all the prims of the object if the root has a running script with a money event).
  • The effect seems to persist even if the script is recompiled with out the llSetPayPrice function, even if the script is replaced with another one which includes a money event, but not llSetPayPrice.
  • Money cannot be paid to an attachment; "Pay" will go directly to the wearer instead.

Important Issues

~ All Issues ~ Search JIRA for related Bugs
   llSetPayPrice doesn't work on Child Prims, default box used instead.


This will give the user a dialog box without the price field and only one button with a value of 150. <lsl>llSetPayPrice(PAY_HIDE, [150,PAY_HIDE,PAY_HIDE,PAY_HIDE])</lsl>

<lsl>integer price = 10;

default {

       llRequestPermissions(llGetOwner(), PERMISSION_DEBIT);
   run_time_permissions(integer perm)
       if(perm & PERMISSION_DEBIT)
           state cash;


state cash {

       llSetPayPrice(price, [price ,PAY_HIDE, PAY_HIDE, PAY_HIDE]);
   money(key id, integer amount)
       if(amount != price)
           llGiveMoney(id, amount);
           llInstantMessage(id, "You paid "+(string)amount+", which is the wrong price, the price is: "+(string)price);
           //insert your give code here.
           llInstantMessage(id, "You paid the right price");

See Also


•  money


•  llGiveMoney

Deep Notes

All Issues

~ Search JIRA for related Issues
   llSetPayPrice doesn't work on Child Prims, default box used instead.
   llSetPayPrice causes "When Left Clicked: Pay Object" to break


•  llSetPayPrice Test


function void llSetPayPrice( integer price, list quick_pay_buttons );