User:Toy Wylie/RLV Documentation/remattach

From Second Life Wiki
Jump to navigation Jump to search


@remattach

Type

# Restriction
  1. General

Implemented

Implemented since RLV version 1.22

Usage

# @remattach[:<attachmentpoint>]=<y/n>
  1. @remattach[:<attachmentpoint>]=force

Purpose

# This is a counterpart function to @remoutfit. Blocks the user from detaching an object from the specified attachment point. The names of the attachment points can be found by right clicking on an attachment in your inventory and navigate to the "Attach To" and "Attach to HUD" menu items. If you don't provide an attachment point, the user will be prevented from detaching anything at all. Using this general detaching block does not remove any single detaching blocks already present. So if you remove the general block later, the single blocks will still be in effect. No items will be detached by this command itself.
  1. See @detach - This function is an alias to provide API consistency.

Notes

* You can't specify more than one attachment point at the same time. You need to do one call for each point you want to block.

See Also

Example

<lsl>integer mode;

default {

   on_rez(integer num)
   {
       llResetScript();
   }

   state_entry()
   {
       mode=0;
       llOwnerSay("Touch me to change the restrictions applied to you.");
   }

   touch_start(integer num)
   {
       if(llDetectedKey(0)==llGetOwner())
       {
           mode++;
           if(mode==3)
           {
               mode=0;
           }

           if(mode==0)
           {
               llOwnerSay("@clear");
               llOwnerSay("You can now detach objects freely once again.");
           }
           else if(mode==1)
           {
               llOwnerSay("@remattach:right hand=n,remattach:left foot=n");
               llOwnerSay("You are now prevented from detaching objects from your right hand and left foot.");
           }
           else if(mode==2)
           {
               llOwnerSay("@remattach:right hand=y,remattach:left foot=y,remattach=n");
               llOwnerSay("You are now prevented from detaching objects overall.");
           }
       }
   }

}

</lsl>