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

LSL Wiki : object_rez

HomePage :: PageIndex :: RecentChanges :: RecentlyCommented :: UserSettings :: You are crawl423.us.archive.org
object_rez(key id)

Triggered when a prim rezzes another object from its inventory via llRezObject. The id is the globally unique key for the object it just rezzed.

This event is raised for all scripts inside the prim that called llRezObject. This allows for having one script do the actual rezzing while another script receives the object_rez events and handles them (for example using llCreateLink to link a newly created prim to the original, root, prim).

Note: object_rez will be triggered only for scripts within the same prim as the script that rezzed the new object. object_rez will not be triggered in scripts contained within other prims of a linked object. It doesn't matter if the rezzer script is contained within the parent or child prims--either will work; object_rez triggers will just be limited to that prim.

This no longer appears to be the case from SL 1.18.3.2-RC and up. If there is no event handler in the child prim, the event will always be passed to the root prim. If there is an event handler in the child prim, however, the event isn't passed to the root prim. - Acru Joliat

object_rez is not to be confused with on_rez which is raised in the newly rezzed object, not the prim that rezzed it.

Example:
default {
    state_entry() {
        llRezObject("Bubu", llGetPos(), ZERO_VECTOR, ZERO_ROTATION, 1);
    }
    
    object_rez(key id) {
        llSay(0, "I made a bubu and its key is " + (string)id);
    }
}

To keep an object's inventory in rezzed objects (from the forums):

object_rez(key child)
{
    llGiveInventory(child,llKey2Name(child));
}


Events | Inventory | Object | Rez
Comments [Hide comments/form]
I've just been stumped for a while by my script calling several instances of llRezObject and failing to get any object_rez events. This is because I was changing state straight after the llRezObject calls. Neither the old state nor the new state was getting the object_rez events, they were just getting lost. This had me stumped for a while. If you want object_rez events, don't change state straight after calling llRezObject ...
-- JonathanShaftoe (2005-02-19 08:58:48)
This is true for any event to my knowledge. Changing states clears the event queues.
-- cpe-75-184-113-113.indy.res.rr.com (2007-06-22 08:21:36)
Attach a comment to this page: