Difference between revisions of "LlDie"

From Second Life Wiki
Jump to navigation Jump to search
m (Fix for alphabetical order in Functions list)
(link with llRemoveInventory that deletes just the script, rather than all of the object that the script contains)
Line 22: Line 22:
     }
     }
}</pre>
}</pre>
|helpers
|helpers=
[[llRemoveInventory]] of [[llGetScriptName]] deletes just the calling script, rather than all of the object that the calling script contains. For instance, you can write a script that chats a little when dragged on to an object from inventory and then politely disappears itself, such as:
<pre>
default
{
    state_entry()
    {
        llOwnerSay("llGetRegionTimeDilation()");
        llOwnerSay((string) llGetRegionTimeDilation());
        llRemoveInventory(llGetScriptName());
    }
}
</pre>
|also_functions={{LSL DefineRow||[[llDetachFromAvatar]]|}}
|also_functions={{LSL DefineRow||[[llDetachFromAvatar]]|}}
{{LSL DefineRow||[[llBreakLink]]|}}
{{LSL DefineRow||[[llBreakLink]]|}}

Revision as of 11:18, 28 October 2007

Summary

Function: llDie( );

Deletes the object. The object does not go to the owners Inventory:Trash.

If called in any prim in the link set the result will be the deletion of the entire object.
To remove a single prim from an object use llBreakLink first.

Caveats

  • After this function is called there is no way to undo the deletion of the object.
  • Has no effect if called from within an attachment; there is no way to delete an attachment.

Examples

//Counts down from 5 to 1, then dies
default
{
    state_entry()
    {
        integer olf;
        for(olf = 5; olf > 0; --olf)
            llSay(0, (string)olf);
        llDie();
    }
}

Useful Snippets

llRemoveInventory of llGetScriptName deletes just the calling script, rather than all of the object that the calling script contains. For instance, you can write a script that chats a little when dragged on to an object from inventory and then politely disappears itself, such as:

default
{
    state_entry()
    {
        llOwnerSay("llGetRegionTimeDilation()");
        llOwnerSay((string) llGetRegionTimeDilation());
        llRemoveInventory(llGetScriptName());
    }
}

See Also

Functions

•  llDetachFromAvatar
•  llBreakLink

Articles

•  Attachment

Deep Notes

Signature

function void llDie();