“LlCreateLink”的版本间的差异
| 第5行: | 第5行: | ||
| |函数名 = Function:llCreateLink( key target, integer parent ); | |函数名 = Function:llCreateLink( key target, integer parent ); | ||
| |参数= 参数:   | |参数= 参数:   | ||
| − | •key	target	–	 | + | •key	target	–	在同一地区的 UUID	 | 
| − | • integer	parent	–	 | + | |
| + | • integer	parent	–	如果是FALSE,那么目标就变成了根。如果是TRUE,那么脚本所在物体就变成了根。	 | ||
| |返回值=返回值:试图将脚本的对象与目标连接起来 | |返回值=返回值:试图将脚本的对象与目标连接起来 | ||
2021年8月17日 (二) 03:17的版本
| 首页 | 函数 | 事件 | 类型 | 操作符 | 常数 | Flow Control | Script Library | Categorized Library | Tutorials | 
| 函数名 | 
|---|
| Function:llCreateLink( key target, integer parent ); | 
| 参数: •key target – 在同一地区的 UUID • integer parent – 如果是FALSE,那么目标就变成了根。如果是TRUE,那么脚本所在物体就变成了根。 | 
| 返回值:试图将脚本的对象与目标连接起来 | 
| 注意事项 | 
|---|
| 这个函数使脚本休眠1.0秒。 Permissions 不依赖于权限的自动授予状态。 总是使用运行时权限事件。 如果脚本缺少权限更改链接,脚本将在调试通道上喊出一个错误,操作失败(但脚本继续运行)。 如果权限更改链接是由所有者以外的任何人授予的,那么当函数被调用时,将在调试通道上呼叫一个错误。 一旦权限变更链接权限被授予,除了从脚本内部(例如,新的 llrequestpermission call)或脚本被重置或删除之外,没有其他方法来撤销它。 如果对象或目标不可修改或者拥有不同的所有者,则在调试通道中喊出错误。 如果父对象和目标之间的距离太远,它们将无法进行链接。最大距离在这里进一步解释: 链接性规则如果从附件中的脚本调用,这个函数将无声地失败. | 
| 示例 | 
|---|
| // Rez an object and link it as a child prim.
string ObjectName = "Object Name Here";
// NOTE: must be a name of an object in this object's inventory.
 
default
{
    touch_start(integer count)
    {
        // When the object is touched, make sure we can do this before trying.
        llRequestPermissions(llGetOwner(), PERMISSION_CHANGE_LINKS);
    }
    run_time_permissions(integer perm)
    {
        // Only bother rezzing the object if will be able to link it.
        if (perm & PERMISSION_CHANGE_LINKS)
            llRezObject(ObjectName, llGetPos() + <0,0,0.5>, ZERO_VECTOR, llGetRot(), 0);
        else
            llOwnerSay("Sorry, we can't link.");
    }
    object_rez(key id)
    {
        // NOTE: under some conditions, this could fail to work.
        // This is the parent object.  Create a link to the newly-created child.
        llCreateLink(id, TRUE);
    }
}
 | 
| 相关函数 | 
|---|
| llGetPermissions-获得许可 llGetPermissionsKey-找到授予许可的探员 llRequestPermissions-请求权限 llBreakLink-断开连接 llBreakAllLinks-断开所有连接 | 
| 相关事件 | 
|---|
| run time permissions-允许接收事件 changed-CHANGED LINK | 
