Difference between revisions of "LlDie"
Jump to navigation
Jump to search
All Issues ~ Search JIRA for related Bugs
m (link back here from distributed copies of the useful snippet) |
Void Singer (talk | contribs) m (formatted example) |
||
Line 11: | Line 11: | ||
**To detach an object from the avatar call [[llDetachFromAvatar]] | **To detach an object from the avatar call [[llDetachFromAvatar]] | ||
|constants | |constants | ||
|examples=< | |examples= | ||
<lsl>//Counts down from 5 to 1, then dies | |||
default | default | ||
{ | { | ||
Line 21: | Line 22: | ||
llDie(); | 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 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: | ||
< | <lsl> | ||
// http://wiki.secondlife.com/wiki/llDie | // http://wiki.secondlife.com/wiki/llDie | ||
default | default | ||
Line 35: | Line 36: | ||
} | } | ||
} | } | ||
</ | </lsl> | ||
|also_functions={{LSL DefineRow||[[llDetachFromAvatar]]|}} | |also_functions={{LSL DefineRow||[[llDetachFromAvatar]]|}} | ||
{{LSL DefineRow||[[llBreakLink]]|}} | {{LSL DefineRow||[[llBreakLink]]|}} |
Revision as of 09:57, 11 February 2008
LSL Portal | Functions | Events | Types | Operators | Constants | Flow Control | Script Library | Categorized Library | Tutorials |
Summary
Function: llDie( );41 | Function ID |
0.0 | Forced Delay |
0.0 | Energy |
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.
- To detach an object from the avatar call llDetachFromAvatar
Examples
<lsl>//Counts down from 5 to 1, then dies default {
state_entry() { integer olf; for(olf = 5; olf > 0; --olf) llSay(0, (string)olf); llDie(); }}</lsl>
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: <lsl> // http://wiki.secondlife.com/wiki/llDie default {
state_entry() { llOwnerSay("llGetRegionTimeDilation()"); llOwnerSay((string) llGetRegionTimeDilation()); llRemoveInventory(llGetScriptName()); }
} </lsl>