LlCreateLink

From Second Life Wiki

Jump to: navigation, search

Function: llCreateLink( key target, integer parent );

141 Function ID
1.0 Delay
10.0 Energy

Attempt to link the script's object with target.

• key target A prim in the same region.
• integer parent If FALSE, then target becomes the root. If TRUE, then the script's object becomes the root.


Requires the PERMISSION_CHANGE_LINKS permission, granted by the owner, to run.
target must be modifiable and have the same owner.
This object must also be modifiable.

Specification

The prims for the child object (target if parent is TRUE, script's object if parent is FALSE) are inserted into the parent object's link set starting at link number 2. For example, if the link order for the parent object is A1, A2, A3 and the link order of the child object is B1, B2, B3, then the link order of the resulting object will be A1, B1, B2, B3, A2, A3.

Caveats

  • This function causes the script to sleep for 1.0 seconds.
  • 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 then the owner then when the function is called an error will be shouted on DEBUG_CHANNEL.
  • If target is not in the region or an object, an error is shouted on DEBUG_CHANNEL.
  • If either the object or the target are not modifiable or of different owners, then an error is shouted on DEBUG_CHANNEL.
  • If the the parent object and target are too far apart (based on their physical size), they will fail to link.

Examples

See Also

Events

•  run_time_permissions Permission receiving event

Functions

•  llGetPermissions Get the permissions granted
•  llGetPermissionsKey Get the agent who granted permissions
•  llRequestPermissions Request permissions
•  llBreakLink Break a link
•  llBreakAllLinks Break all links

Articles

•  Script permissions
•  Linkability Rules
Personal tools