User:Toy Wylie/RLV Documentation/addattach

From Second Life Wiki
Jump to navigation Jump to search


@addattach

Type

Restriction

Implemented

Implemented since RLV version 1.22

Usage

@addattach[:<attachmentpoint>]=<y/n>

Purpose

This is a counterpart function to @addoutfit. Blocks the user from attaching anything to 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 attaching anything at all. Using this general attachment block does not remove any single attachment blocks already present. So if you remove the general block later, the single blocks will still be in effect. Attaching attempts by llAttachToAvatar() will be stopped by detaching the object right away. No items will be detached by this command itself.

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 attach objects freely once again.");
           }
           else if(mode==1)
           {
               llOwnerSay("@addattach:right hand=n,addattach:left foot=n");
               llOwnerSay("You are now prevented from attaching objects to your right hand and left foot.");
           }
           else if(mode==2)
           {
               llOwnerSay("@addattach:right hand=y,addattach:left foot=y,addattach=n");
               llOwnerSay("You are now prevented from attaching objects overall.");
           }
       }
   }

}

</lsl>