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)
key llRezObjectWithParams( string inventory, list params );
Forced delay: 0.1 seconds. Energy: 200.0.
Returns a key which will be the key of the object when it is successfully rezzed in the world.
llGetPos doesn't return the position of the attachment but instead returns the position of the avatar's bounding box geometric center. Read llGetPos and llParticleSystem Caveats for more information.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);
}
}
}
Maximum rez distance
10 + llVecMag(llGetScale()) * 0.50.01 meter cube could rez just beyond 10.0 meters away.10.0 meter cube could rez just beyond 18.66 meters away.32.0 meter cube could rez just beyond 37.71 meters away.64.0 meter cube could rez just beyond 65.42 meters away.