Attaches the object to the avatar who has granted permission to the script. The object is taken into the users inventory and attached to attach_point.
void llAttachToAvatar( integer attach_point );
Forced delay: 0.0 seconds. Energy: 10.0.
To run this function the script must request the PERMISSION_ATTACH permission with llRequestPermissions and it must be granted by the owner.
If attach_point is zero, then the object attaches to the attach point it was most recently attached to.
Constants in italic require a viewer compatible with the Project Bento skeleton.
Body
|
HUD
Special
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Permissions
//-- rez object on ground, drop in this script, it will request permissions to attach,
//-- and then attach to the left hand if permission is granted. if permission is denied,
//-- then the script complains.
default
{
state_entry()
{
llRequestPermissions( llGetOwner(), PERMISSION_ATTACH );
}
run_time_permissions( integer vBitPermissions )
{
if ( vBitPermissions & PERMISSION_ATTACH )
llAttachToAvatar( ATTACH_LHAND );
else
llOwnerSay( "Permission to attach denied" );
}
on_rez(integer rez)
{
if (!llGetAttached() ) //reset the script if it's not attached.
llResetScript();
}
attach(key id)
{
// The attach event is called on both attach and detach, but 'id' is only valid on attach
if (id)
llOwnerSay( "The object is attached to " + llKey2Name(id) );
else
llOwnerSay( "The object is not attached");
}
}