User:Toy Wylie/RLV Documentation/addattach

From Second Life Wiki
< User:Toy Wylie‎ | RLV Documentation
Revision as of 05:07, 8 July 2010 by Toy Wylie (talk | contribs) (first draft)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
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. 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.


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

}

</lsl>