Detach object from avatar.

Syntax

void llDetachFromAvatar();

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.

The detached object is no longer present in the sim. There is no lsl equivilent of the "Drop" command that moves an attachment onto the ground. Use llRezObject if you need similar behavior

Caveats

Permissions

Examples

default
{
    attach(key AvatarKey)
    {//give instructions for use and prevent item from being attached to avatar
        if(AvatarKey)
        {//event is called on both attach and detatch, but Key is only valid on attach
            llOwnerSay ("
            We hope you will enjoy your purchase, 
            but if you really want to use this item properly, you should: 
            1) drag it from your inventory to the ground 
            2) Right click on it and select \"open\"
            3) copy its contents to inventory.");

            llRequestPermissions(AvatarKey, PERMISSION_ATTACH );
        }
    }
    run_time_permissions(integer perm)
    {
        if(perm & PERMISSION_ATTACH)
        {
            llDetachFromAvatar( );
        }
    }
}

Notes

There is no way to delete an attachment with a script or to drop it to the ground.

See also

Events

Functions

Articles

Deep notes

Issues