Difference between revisions of "LlBreakAllLinks"

From Second Life Wiki
Jump to navigation Jump to search
(Added Example)
m
 
(9 intermediate revisions by 7 users not shown)
Line 3: Line 3:
|func_id=143|func_sleep=0.0|func_energy=10.0
|func_id=143|func_sleep=0.0|func_energy=10.0
|func=llBreakAllLinks
|func=llBreakAllLinks
|func_desc=Delinks all tasks in the link set.
|func_desc=Delinks all prims in the link set.
|func_footnote
|func_footnote
|return_text
|return_text
|spec
|spec
|caveats
|caveats=
*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.
|constants
|constants
|examples=
|examples=
<pre>
<source lang="lsl2">
// Makes the object explode if there are more than 5 (or so) links.  
//-- requests permission to change linkes, then breaks all links on touch.
// If there are more than 200 links this will cause the region to slow down A LOT.
default{
// Useful if you want vehicles to explode when being shot at.
  state_entry(){
// This script assumes that the user already has PERMISSION_CHANGE_LINKS.
    llRequestPermissions( llGetOwner(), PERMISSION_CHANGE_LINKS );
// If it does not, THIS SCRIPT WILL FAIL!
  }
default {
 
    state_entry() {
  run_time_permissions( integer vBitPermissions ){
          llSetStatus(STATUS_PHYSICS, 1); //Make it physical, if it isn't already.
    if (PERMISSION_CHANGE_LINKS & vBitPermissions){
          llBreakAllLinks(); //KA-BOOM!
      state sMain;
          llRemoveInventory(llGetScriptName()); //Delete this script.
    }else{
    }
      llResetScript();
    }
  }
}
}
</pre>
 
state sMain{
  touch_start( integer vIntTouched ){
    llBreakAllLinks();
  }
}
</source>
|helpers
|helpers
|also_functions={{LSL DefineRow||[[llBreakLink]]|Break a link}}
|also_functions={{LSL DefineRow||[[llBreakLink]]|Break a link}}
{{LSL DefineRow||[[llCreateLink]]|Link to another object}}
{{LSL DefineRow||[[llCreateLink]]|Link to another object}}
|also_tests
|also_tests
|also_events
|also_events={{LSL DefineRow||[[changed]]|[[CHANGED_LINK]]}}
|also_articles
|also_articles
|notes
|notes
|cat1=Link
|cat1=Link
|cat2
|cat2=Link/Management
|cat3
|cat3
|cat4
|cat4
}}
}}

Latest revision as of 23:08, 21 January 2015

Summary

Function: llBreakAllLinks( );
0.0 Forced Delay
10.0 Energy

Delinks all prims in the link set.

To run this function the script must request the PERMISSION_CHANGE_LINKS permission with llRequestPermissions and it must be granted by the owner.

Caveats

Permissions
  • 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

//-- 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();
  }
}

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

Articles

•  Script permissions

Deep Notes

Signature

function void llBreakAllLinks();