LlDie: Difference between revisions

From Second Life Wiki
Jump to navigation Jump to search
Kireji Haiku (talk | contribs)
mNo edit summary
Gwyneth Llewelyn (talk | contribs)
m Minor grammar/spelling corrections
 
(10 intermediate revisions by 4 users not shown)
Line 1: Line 1:
{{LSL_Function
{{LSL Function
|inject-2={{Issues/SVC-7421}}
|inject-2={{Warning|This permanently deletes your whole object (root prim and all linked prims). The deleted object WILL NOT appear in your lost-and-found folder. The deleted object WILL NOT appear in your trash folder. It will be gone, lost forever. There will be NO WAY WHATSOEVER to get it back. Use with caution!}}
|inject-3=Huh {{Issues|SVC-7421}}
|func=llDie
|func=llDie
|sort=Die
|sort=Die
|func_id=41|func_sleep=0.0|func_energy=0.0
|func_id=41
|func_footnote=If called in any prim in the {{LSLG|link set}} the result will be the deletion of the entire object.{{PBR}}To remove a single prim from an object use [[llBreakLink]] first.
|func_sleep=0.0
|func_desc=Deletes the object. The object does not go to the owners Inventory:Trash.
|func_energy=0.0
|func_footnote=If called in any prim in the {{LSLG|link set}} the result will be the deletion of the entire object.{{PBR}}To remove a single prim from an object, use [[llBreakLink]] first.
|func_desc=Deletes the object. The object does '''not''' go to the owner's Inventory [[Trash|🗑 Trash]].
|return_text
|return_text
|spec
|spec
|caveats=*After this function is called there is no way to undo the deletion of the object.
|caveats=
*The script may not stop executing immediately after this function is called ({{Jira|SVC-7421}}).
*After this function is called, there is no way to undo the deletion of the object.
*Has no effect if called from within an {{LSLGC|Attachment|attachment}}; there is no way to delete an attachment.
*Has no effect if called from within an {{LSLGC|Attachment|attachment}}; there is no way to delete an attachment.
**To detach an object from the avatar call [[llDetachFromAvatar]]
**To detach an object from the avatar, call [[llDetachFromAvatar]].
**[[llDetachFromAvatar|Detaching]] a [[llAttachToAvatarTemp|temporary attachment]] will cause the attachment to be deleted.
|constants
|constants
|examples=
|examples=
<lsl>
// WARNING:
//      This permanently deletes your whole object (root prim and all linked prims).
//      The deleted object WILL NOT appear in your lost-and-found folder.
//      The deleted object WILL NOT appear in your trash folder.
//      It will be gone, lost forever.


//Counts down from 5 to 1, then dies
default
{
    state_entry()
    {
        integer index = 5;
        while (index)
        {
            // wait a sec
            llSleep(1.0);
            // PUBLIC_CHANNEL has the integer value 0
            llSay(PUBLIC_CHANNEL, (string)index);
            --index;
        }
        llDie();
    }
}
</lsl>
|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:
[[llRemoveInventory]] of [[llGetScriptName]] deletes just the calling script, rather than all of the objects that the calling script contains. For instance, you can write a script that chats a little when dragged onto an object from inventory and then politely disappears itself, such as:
<lsl>
<syntaxhighlight lang="lsl2">
// http://wiki.secondlife.com/wiki/llDie
// http://wiki.secondlife.com/wiki/llDie
default
default
Line 55: Line 33:
     }
     }
}
}
</lsl>
</syntaxhighlight>
|also_functions={{LSL DefineRow||[[llDetachFromAvatar]]|}}
|also_functions={{LSL DefineRow||[[llDetachFromAvatar]]|}}
{{LSL DefineRow||[[llBreakLink]]|}}
{{LSL DefineRow||[[llBreakLink]]|}}
Line 64: Line 42:
|permission
|permission
|negative_index
|negative_index
|haiku={{Haiku|Hey, where did it go?|Assignment. Equality.|Gee, thanks, K & R.}}
|cat1=Object
|cat1=Object
|cat2=Stop
|cat2=Stop
|cat3
|cat3=Cleanup
|cat4
|cat4
}}
}}

Latest revision as of 15:32, 25 January 2026

Summary

Function: llDie( );

Deletes the object. The object does not go to the owner's 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

  • The script may not stop executing immediately after this function is called (SVC-7421).
  • 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

Useful Snippets

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

// http://wiki.secondlife.com/wiki/llDie
default
{
    state_entry()
    {
        llOwnerSay("llGetRegionTimeDilation()");
        llOwnerSay((string) llGetRegionTimeDilation());
        llRemoveInventory(llGetScriptName());
    }
}

See Also

Functions

•  llDetachFromAvatar
•  llBreakLink

Articles

•  Attachment

Deep Notes

Signature

function void llDie();

Haiku

Hey, where did it go?
Assignment. Equality.
Gee, thanks, K & R.