Instantiate inventory object at pos with an initial set of parameters specified in params.

pos will default to the position of the object containing the script, unless REZ_POS is specified. (see below)

Syntax

key llRezObjectWithParams( string inventory, list params );

Forced delay: 0.1 seconds. Energy: 200.0.

Parameters

string inventory
an object in the inventory of the prim this script is in
list params

Return value

Returns a key which will be the key of the object when it is successfully rezzed in the world.

Caveats

Examples

The list of parameters is entirely optional. If you want to rez an object exactly where the rezzer is, you may call the function with an empty list.

default
{
    touch_start(integer total_number)
    {
        llRezObjectWithParams("Object", []);
    }
}

The below example rezzes an object slightly above the rezzer, slowly spinning and with automatic cleanup. See Temporary

default
{
    touch_start(integer total_number)
    {
        llRezObjectWithParams("Object", [
            REZ_FLAGS, REZ_FLAG_TEMP | REZ_FLAG_PHANTOM,
            REZ_POS, <0,0,1>, TRUE, TRUE,
            REZ_OMEGA, <0,0,1>, TRUE, 0.5, PI
        ]);
    }
}

The below is a basic example of firing a typical bullet from a worn attachment. The bullet is fired with a left-click during mouselook.

default
{
    control(key id, integer level, integer edge)
    {
        integer click = level & edge;

        if (click & CONTROL_ML_LBUTTON) {
            llRezObjectWithParams("Bullet", [
                REZ_POS, <2,0,0>, TRUE, TRUE, // Relative offset 2 meters forward
                REZ_ROT, ZERO_ROTATION, TRUE, // Relative rotation
                REZ_VEL, <100,0,0>, TRUE, FALSE, // Relative velocity 100m/s forward
                REZ_DAMAGE, 40,
                REZ_LOCK_AXES, <1,1,1>, // Disable all rotation
                REZ_FLAGS, 0
                | REZ_FLAG_PHYSICAL
                | REZ_FLAG_TEMP
                | REZ_FLAG_DIE_ON_COLLIDE
                | REZ_FLAG_DIE_ON_NOENTRY
                | REZ_FLAG_NO_COLLIDE_OWNER
                | REZ_FLAG_NO_COLLIDE_FAMILY
                | REZ_FLAG_BLOCK_GRAB_OBJECT
            ]);
        }
    }

    run_time_permissions(integer perm)
    {
        if (perm) {
            llTakeControls(CONTROL_ML_LBUTTON, TRUE, FALSE);
        }
    }

    attach(key id)
    {
        if (id) {
            llRequestPermissions(llGetOwner(), PERMISSION_TAKE_CONTROLS);
        }
    }

    state_entry()
    {
        if (llGetAttached()) {
            llRequestPermissions(llGetOwner(), PERMISSION_TAKE_CONTROLS);
        }
    }
}

Notes

Maximum rez distance

See also

Constants

Events

Functions