Jump to content

LlBreakAllLinks

From OSgrid Wiki

Function: llBreakAllLinks( );

Delinks all prims in the link set.
Requires the PERMISSION_CHANGE_LINKS permission, granted by the owner, to run.

Caveats
• Do not depend upon the auto-grant status of permissions. Always use the run_time_permissions event.
• If the script lacks the permission PERMISSION_CHANGE_LINKS, the script will shout an error on DEBUG_CHANNEL and the operation fails (but the script continues to run).
• If PERMISSION_CHANGE_LINKS is granted by anyone other than the owner, then when the function is called an error will be shouted on DEBUG_CHANNEL.
• Once the PERMISSION_CHANGE_LINKS permission is granted there is no way to revoke it. The script will only lose the permission if it is reset or the object derezzed (deleted, detached, or taken).
• This function fails if the owner does not have edit permissions on the object containing the script, the system message "Delink failed because you do not have edit permission" is received by the owner.

Examples

<source lang="lsl">

//-- requests permission to change linkes, then breaks all links on touch. default{

 state_entry(){
   llRequestPermissions( llGetOwner(), PERMISSION_CHANGE_LINKS );
 }

 run_time_permissions( integer vBitPermissions ){
   if (PERMISSION_CHANGE_LINKS & vBitPermissions){
     state sMain;
   }else{
     llResetScript();
   }
 }

}

state sMain{

 touch_start( integer vIntTouched ){
   llBreakAllLinks();
 }

} </source>

See Also
Events
• run_time_permissions – Permission receiving event
• changed – CHANGED_LINK
Functions
• llGetPermissions – Get the permissions granted
• llGetPermissionsKey – Get the agent who granted permissions
• llRequestPermissions – Request permissions
• llBreakLink – Break a link
• llCreateLink – Link to another object