Difference between revisions of "LlDie"

From Second Life Wiki
Jump to navigation Jump to search
m
m
 
Line 17: Line 17:
|constants
|constants
|examples=
|examples=
<lsl>
<source lang="lsl2">
default
default
{
{
Line 32: Line 32:
     }
     }
}
}
</lsl>
</source>
<lsl>
<source lang="lsl2">
//Counts down from 5 to 1, then dies
//Counts down from 5 to 1, then dies
default
default
Line 50: Line 50:
     }
     }
}
}
</lsl>
</source>
|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>
<source lang="lsl2">
// http://wiki.secondlife.com/wiki/llDie
// http://wiki.secondlife.com/wiki/llDie
default
default
Line 64: Line 64:
     }
     }
}
}
</lsl>
</source>
|also_functions={{LSL DefineRow||[[llDetachFromAvatar]]|}}
|also_functions={{LSL DefineRow||[[llDetachFromAvatar]]|}}
{{LSL DefineRow||[[llBreakLink]]|}}
{{LSL DefineRow||[[llBreakLink]]|}}

Latest revision as of 00:05, 22 January 2015

Emblem-important-red.png 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!

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

  • 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

default
{
    state_entry()
    {
        // red and opaque text
        llSetText("<!-- touch to kill --!>", <1.0, 0.0, 0.0>, 1.0);
    }

    touch_start(integer num_detected)
    {
        llSay(0, "Good bye, cruel world!");
        llDie();
    }
}
//Counts down from 5 to 1, then dies
default
{
    state_entry()
    {
        integer index = 5;
        while (index)
        {
            // wait a sec
            llSleep(1.0);
            llSay(0, (string)index);
            --index;
        }
        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:

// 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.