Money
From Second Life Wiki
| LSL Portal | | | Functions | | | Events | | | Types | | | Operators | | | Constants | | | Flow Control | | | Script Library | | | Tutorials |
| | Security Warning |
|
Always (ALWAYS!) check the amount paid. |
SpecificationWhen money is paid to the prim, the money is given to the object's owner. |
Caveats
|
Examplesinteger price = 10; default { state_entry() { llSetPayPrice(PAY_HIDE, [PAY_HIDE ,PAY_HIDE, PAY_HIDE, PAY_HIDE]); llRequestPermissions(llGetOwner(), PERMISSION_DEBIT); } run_time_permissions(integer perm) { if(perm & PERMISSION_DEBIT) state cash; } } state cash { state_entry() { 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); } else { llInstantMessage(id, "You paid the right price"); } } } |

