LSL Wiki Mirror 7-7-7 : object_rez

HomePage :: PageIndex :: RecentChanges :: RecentlyCommented :: UserSettings ::
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.

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
There are 2 comments on this page. [Display comments/form]