Don't click here unless you want to be banned.

LSL Wiki : llDie

HomePage :: PageIndex :: RecentChanges :: RecentlyCommented :: UserSettings :: You are crawl427.us.archive.org
llDie();

Deletes the object that contains the script. That means if the prim containing this script is part of a linkset, all the prims will be deleted, regardless of whether or not the prim is the root or a child in the linkset. To delete just one prim from a linkset, first detach it with llBreakLink.

llDie will not work for attachments. Use llDetachFromAvatar instead.

Warning: Objects deleted via llDie are NOT returned to the owner's inventory (not even to their "Trash" folder). There is no way to get them back.

Q: How do I delete another object?
A: You can't. Your best option is to place a script inside the object you wish to delete and then use chat to tell it when to do so.
Alternatively, llGiveInventory can be used to give a copy of a script to another object, but the script will always be turned off within the recipient object. Scripts can only be turned on by manually activating them.
llRemoteLoadScriptPin may be useful, but if you can already get into the object that way, you can likely put a script containing llDie in it already.

Q: How do I make my object delete itself after a certain period of time?
A: Use llSleep or the timer event.

Q: How do I make my object delete itself if it goes off my land?
A: Use a timer and llGetLandOwnerAt(llGetPos()).

Q: How do I make my object delete or return itself when it leaves the sim?
A: See llSetStatus and the STATUS_DIE_AT_EDGE and STATUS_RETURN_AT_EDGE constants.

Q: Is there an event that runs when the object is deleted or taken into inventory?
A: No. The attach() event will be triggered when detaching an attached object, but that's it. llDie will not do anything within an attachment, however.
If you're wanting to create some sort of cleanup function or to disable your object after use, (to create a demo version, or something that expires, for instance) use on_rez() and some kind of counter.


This article wasn't helpful for you? Maybe the related article at the LSL Portal is able to bring enlightenment.

Functions | Rez
Comments [Hide comments/form]
If you're trying to detect object's owner (llGetOwnerKey()) or something like that, just before it dies, don't. Lag slows the detection to the point where the object is already dead and it's key is invalid, thus has no owner.
-- MeLightKorvin (2006-04-13 03:48:52)
Attach a comment to this page: