Skip to content
lsl.devlsl.devLSL Dev

LlGiveMoney

Looking for the current API? Open the llGiveMoney reference →

Wiki description

Transfer amount of L$ money from script owner to destination avatar.

Return value notes

Returns an integer that is always zero. In contrast llTransferLindenDollars returns a key that can be used to match the function call to the resulting transaction_result event and the transaction history.

Caveats

  • An object cannot pay another object.
  • It is impossible for a script to tell if an llGiveMoney transaction succeeded or failed. Use llTransferLindenDollars instead.
  • Objects deeded to groups cannot give money (the permission cannot be granted).
  • Use is limited to 30 payments in a 30 second interval for all scripts owned by that resident on a region. Sustained overage will produce a script error and halt payments while the rate remains excessive. Historically, faster payments have failed intermittently.
  • Once a script has the PERMISSION_DEBIT permission it can empty an account of L$.
    • Fraud & theft are both LL: {{LL|TOS}} violations and crimes. Misuse this function and you risk being banned and legal action. In addition LL may freeze the accounts of anyone the money is transferred to and restore it to it's rightful owners. This may involve retrieving it from third party exchanges and accounts on those exchanges being frozen. The system is not designed to be friendly towards fraud.

Examples

// Pay 100 L$ to Fred Bloggs when he touches this prim, then die
// Compare this example with that shown under llTransferLindenDollars

string  Recipient = "Fred Bloggs";      // Authorised recipient
integer Amount = 100;                   // Amount to pay Fred when he touches the prim
integer DebitPerms;

default
{
    state_entry()
    {
        // Ask the owner for permission to debit their account
        llRequestPermissions(llGetOwner(), PERMISSION_DEBIT);
    }

    run_time_permissions (integer perm)
    {
        if  (perm & PERMISSION_DEBIT)
            DebitPerms = TRUE;
    }

    touch_start(integer num_detected)
    {
        if (!DebitPerms)
            return;                     // Cannot proceed - debit permissions not granted
        if (llDetectedName(0) != Recipient)
            return;                     // unauthorised person is touching - ignore

        key id = llDetectedKey(0);      // Get toucher's (i.e. Fred's) UUID
        llGiveMoney(id, Amount);        // Give him the money
        llDie();                        // Die so Fred can't keep taking money
    }
}

See also: functions

See also: events

Shared wiki helpers

The original page also injects shared parameter notes, caveats or issue information through these helpers. Their conditional MediaWiki logic is not reproduced here; inspect the preserved helper source for additional material.

Template:LSL Function/warning

Original shared helper source (conditional wiki logic is not evaluated)
<noinclude>{{Multi-lang|category=LSL}}</noinclude>{{#if:{{#var:fw-multiple}}|{{#vardefine:fw-multiple|{{#expr:{{#var:fw-multiple}}+1}}}}
<span style="font-size:120%;">'''{{{1}}} Warning'''<span>
<div>
{{{2}}}
</div>
|{{#vardefine:header|{{#var:header}}{{#vardefine:fw-multiple|0}}{{#if:{{{2}}}}}{{#vardefine:fw-title|{{{1}}} Warning{{#ifexpr:{{#var:fw-multiple}} > 1|s}}!}}
{{{!}} style="background-color:#AAAAAA; margin-bottom:10px;" cellpadding="3" cellspacing="1"
{{!}} style="background:white;" valign="top" rowspan="2" {{!}} [[Image:Emblem-important-red.png]]
{{!}} style="color:white; background:#990000;" title="{{#var:fw-title}}" width="100%" {{!}} '''{{#var:fw-title}}'''
{{!}}-
{{!}} style="background:#F9F9F9; font-size:90%;" {{!}}
{{{2}}}
{{!}}} }}{{#if:{{{inline|}}}<noinclude>t</noinclude>|{{#var:header}}|{{LSL Injection Test}}}}{{#vardefine:fw-multiple|}}{{#vardefine:fw-title|}}}}

Template:LSL Function/permission

Original shared helper source (conditional wiki logic is not evaluated)
{{#if:

{{{{#if:{{#var:DEBUG_CHANNEL}}||:DEBUG_CHANNEL}}|}}

{{#vardefine:header_footnote|{{#var:header_footnote}}{{#if:{{{1|<noinclude>*</noinclude>}}}|To run this function the script must request the [[{{{1}}}]] {{#if:{{{2|}}}|or [[{{{2}}}]]}} permission with [[llRequestPermissions]]{{#ifeq:{{{grant|anyone}}}|anyone||&#32;and it must be granted by {{{grant|anyone}}}}}.}}}}

{{#vardefine:caveats|{{#var:caveats}}{{#if:{{{1|<noinclude>*</noinclude>}}}|{{PBR}}
<div style="border: 1px dotted rgba(0,0,0,0.5);">{{Collapsible_Table/Simple|title=<h5 style="margin:0;">Permissions</h5>|table-style=width:100%;|autocollapse=*|content={{!}}<div>
* Do not depend upon the auto-grant status of permissions. '''Always''' use the [[run_time_permissions]] event.
* If the script lacks {{#if:{{{2|}}}|both the permissions [[{{{1}}}]] and [[{{{2}}}]]|the permission [[{{{1}}}]]}}, the script will shout an error on {{#var:DEBUG_CHANNEL}} and the operation fails (but the script continues to run).{{#ifeq:{{{grant|anyone<noinclude>*</noinclude>}}}|anyone||
* If [[{{{1}}}]] {{#if:{{{2|}}}|or [[{{{2}}}]]}} is granted by anyone other than {{{grant|anyone}}}, then when the function is called an error will be shouted on {{#var:DEBUG_CHANNEL}}.}}
{{{caveats|}}}{{LSL Function/permission/caveat switch|{{{1}}}}}{{#if:{{{2|}}}|{{LSL Function/permission/caveat switch|{{{2}}}}}}}</div>}}</div>}}}}

{{#vardefine:also_events|{{#var:also_events}}
{{LSL DefineRow||[[run_time_permissions]]|Permission receiving event}}}}
{{#vardefine:also_functions|{{#var:also_functions}}
{{LSL DefineRow||[[llGetPermissions]]|Get the permissions granted}}
{{LSL DefineRow||[[llGetPermissionsKey]]|Get the agent who granted permissions}}
{{LSL DefineRow||[[llRequestPermissions]]|Request permissions}}}}
{{#vardefine:also_articles|{{#var:also_articles}}
{{LSL DefineRow||[[:Category:LSL Permissions/Script|Script permissions]]|}}}}

<includeonly>{{#if:{{{nc|}}}||{{#vardefine:hidden-text|{{#var:hidden-text}}
{{#if:{{#pos:{{#var:moded}}|r}}{{#pos:{{#var:moded}}|u}}||[[Category:LSL Requires Permissions]]}}
}}}}</includeonly>

}}<noinclude>
{| {{Prettytable}}
|-{{Hl2}}
! #var
! value
|-
{{VarPair|header_footnote}}
|-
{{VarPair|caveats}}
|-
{{VarPairTable|also_events}}
|-
{{VarPairTable|also_functions}}
|-
{{VarPairTable|also_articles}}
|}
</noinclude>

Template:LSL Function/avatar

Original shared helper source (conditional wiki logic is not evaluated)
{{LSL Injection Test}}<noinclude>{{Multi-lang|category=LSL}}</noinclude>{{#if:

{{#vardefine:p_{{{1|none}}}_desc|avatar {{#if:{{{group|}}}|or group}} {{HoverLink|UUID|Universally Unique Identifier}} {{#if:{{{sim|}}}{{{region|}}}|that is in the same [[region]] {{#ifeq:{{{sim|}}}{{{region|}}}|known|or is otherwise known to the region{{Footnote|handle=known}}}}}}}}

{{#vardefine:p_{{{1|none}}}_hover|avatar {{#if:{{{group|}}}|or group}} UUID {{#if:{{{sim|}}}{{{region|}}}|that is in the same region {{#ifeq:{{{sim|}}}{{{region|}}}|known|or is otherwise known to the region}}}}}}

<includeonly>
{{#if:{{{nc|}}}||{{#vardefine:hidden-text|{{#var:hidden-text}}
{{#if:{{#pos:{{#var:moded}}|r}}{{#pos:{{#var:moded}}|u}}||{{LSLC|Avatar/As A Parameter||{{#var:lang}}}}}}
}}}}
</includeonly>

}}<noinclude>
{| {{Prettytable}}
|-{{Hl2}}
! #var
! value
|-
{{VarPair|p_{{{1|none}}}_desc}}
|-
{{VarPair|p_{{{1|none}}}_hover}}
|}
</noinclude>
Original wiki source

Some wiki templates and tables need their original context. View this article on the Second Life Wiki. Technical wording and examples are retained from the source; historical guidance may differ from current behavior.