User:Toy Wylie/RLV Documentation/detach
Jump to navigation
Jump to search
@detach
Type
# Restriction
- General
- General
Implemented
Implemented since RLV version
- 1.0a
- 1.20
- 1.11
Usage
# @detach[:<attachmentpoint>]=<y/n>
- @detach[:<attachmentpoint>]=force
- @detach:<folder/path>=force
Purpose
# Locks an attachment point. The user won't be able to attach or detach anything to or from this attachment point. Leaving out the attachment point will result in a block of the attachment point of the object issuing the command only.
- Force detaches the attachment at the specified attachment point. If no attachment point is given, it will detach all attachments currently worn (which are not locked).
- Force detaches and unwears all items of the specified folder. If the folder has the same name as an attachment point, only that attachment point will be detached, so make sure not to name your folders after attachment points.
See Also
Example 1
<lsl>lock()
{
llOwnerSay("@detach=n"); llOwnerSay("This attachment is now locked on. It will unlock automatically in 30 seconds."); llSetTimerEvent(30.0);
}
default {
on_rez(integer num) { llResetScript(); } state_entry() { if(llGetAttached()==0) { llOwnerSay("@acceptpermission=add"); llOwnerSay("Please attach me to your avatar."); llRequestPermissions(llGetOwner(),PERMISSION_ATTACH); return; } lock(); }
attach(key k) { if(k!=NULL_KEY) { lock(); } }
touch_start(integer num) { if(llDetectedKey(0)==llGetOwner()) { llOwnerSay("@detach=force"); llOwnerSay("Now all of your unlocked attachments have been detached."); } }
timer() { llSetTimerEvent(0.0); llOwnerSay("@detach=y"); llOwnerSay("This attachment is now unlocked."); }
run_time_permissions(integer perms) { if(perms & PERMISSION_ATTACH) { llAttachToAvatar(ATTACH_RHAND); } }
}
</lsl>Example 2
<lsl>string folder="Outfits/Casual/Streetwear";
default {
on_rez(integer num) { llResetScript(); } state_entry() { llOwnerSay("Touch me to detach the contents of the folder #RLV/"+folder); } touch_start(integer num) { if(llDetectedKey(0)==llGetOwner()) { llOwnerSay("@detach:"+folder+"=force"); llOwnerSay("Folder contents have been detached."); } }
}
</lsl>