Skip to content
lsl.devlsl.devLSL Dev

on_rez

event
Event syntax
on_rez(
  1. integer start_param// Integer start parameter passed from the rezzing call.
) { … }

start_param is always zero when an object is not rezzed by llRezObject or llRezAtRoot.

When an object is rezzed by llRezObject or llRezAtRoot, then start_param will be the value given as the last parameter of the rezzing command.

start_param is available at any subsequent time by calling llGetStartParameter (unless it has been overridden by llRemoteLoadScriptPin). Passes start_param from the rezzing call (or 0 if rezzed from inventory).

Triggered when an object is rezzed (by script or by user). Also triggered in attachments when a user logs in, or when the object is attached from inventory.

How to use
on_rez(integer start_param)
{
}
  • If an object is rezzed by another object then the object_rez event in the parent object does not trigger at the same time as the on_rez event in the child object and the order of the events is not guaranteed. See the examples in object_rez for how to reliably establish communications between objects when rezzing.
Example 1
default
{
on_rez(integer start_param)
{
// Restarts the script every time the object is rezzed
llResetScript();
}
}

state_entry will be triggered prior to on_rez if state_entry has not been run prior.

on_rez will be triggered prior to attach when attaching from inventory or during login.

If the script was already processing an event at rez time, on_rez does not not trigger until the current event handler is completed. (same with attach)

  • object_rez — triggered when this object rezzes an object from inventory
  • state_entry — triggered during script startup, reset and state change
Original wiki source

Some wiki templates and tables need their original context. View this article on the Second Life Wiki. Technical wording and examples are retained from the source; historical guidance may differ from current behavior.

From the Second Life Wiki

Community documentation adapted from On rez, by Linden Research, Inc. and contributing residents.View contributors and history.

Imported wiki revision:

  • On rez (revision 1212503, )

Licensed under CC BY-SA 3.0. Last wiki edit: .Formatting and links have been adapted for this site; API metadata follows the LSL definitions.