“LlSetDamage”的版本间的差异
|  (创建页面,内容为“{{LSL Header|ml=*}}{{LSLC|Keywords}}{{LSLC|Flow Control}}{{LSLC|}}   {{函数详情 |函数名 = Function: llSetDamage( float damage );  |参数= 参数:• float…”) | |||
| 第24行: | 第24行: | ||
| <pre> | <pre> | ||
| //Simple autokiller bullet: | //Simple autokiller bullet: | ||
| − | //  | + | //如果在启用伤害的土地上与化身接触,这将在碰撞时立即“杀死”。 | 
| default | default | ||
| { | { | ||
| − |      on_rez(integer param) //  | + |      on_rez(integer param) // 当rezzed时变得活跃。 | 
|      { |      { | ||
| − |          llSetDamage(100.0); //  | + |          llSetDamage(100.0); // 将伤害设置为最大。 | 
| − |          llSensor("", "", AGENT, 96.0, PI); //  | + |          llSensor("", "", AGENT, 96.0, PI); // 在96米范围内搜寻探员。 | 
|      } |      } | ||
|      sensor(integer num) // If an agent is detected... |      sensor(integer num) // If an agent is detected... | ||
|      { |      { | ||
| − |          llSetStatus(STATUS_PHYSICS, TRUE); //  | + |          llSetStatus(STATUS_PHYSICS, TRUE); // 使物理允许物理运动。 | 
|          llSetTimerEvent(10.0); // Set a 10 second timer. |          llSetTimerEvent(10.0); // Set a 10 second timer. | ||
| − |          llMoveToTarget(llDetectedPos(0), 0.5); //  | + |          llMoveToTarget(llDetectedPos(0), 0.5); //移动到检测到的位置. | 
|      } |      } | ||
| − |      no_sensor() //  | + |      no_sensor() // 如果没有检测到代理… | 
|      { |      { | ||
|          llDie(); // Auto destruct. |          llDie(); // Auto destruct. | ||
|      } |      } | ||
| − |      timer() //  | + |      timer() // 如果我们没击中目标… | 
|      { |      { | ||
|          llDie(); // Auto destruct. |          llDie(); // Auto destruct. | ||
2020年8月22日 (六) 06:34的最新版本
| 首页 | 函数 | 事件 | 类型 | 操作符 | 常数 | Flow Control | Script Library | Categorized Library | Tutorials | 
| 函数名 | 
|---|
| Function: llSetDamage( float damage ); | 
| 参数:• float damage – range: 0.0 (no damage) ~ 100.0 (instant kill) | 
| 返回值:设置当该对象击中avatar时所造成的伤害。 | 
| 注意事项 | 
|---|
| 如果伤害大于或等于100.0,该对象会立即杀死一个完全健康的化身。 如果损害小于或等于零,则不会造成损害,该对象也不会死亡,碰撞或land_collision事件将被排队处理。 如果一个激活了伤害的物体击中了一个激活了物理的物体,而这个物体正坐在一个虚拟人物身上,那么虚拟人物就会像被直接击中一样受到伤害 Specification 当物体与虚拟化身碰撞时,虚拟化身会受到伤害… 对象不能是phantom或llVolumeDetect(TRUE) 化身必须在“安全(无伤害)”被禁用的土地上。 然而,该对象不需要在伤害激活土地上或甚至部分超过。 当这些前提条件得到满足时,化身就会受到伤害,对象就会在不调用碰撞事件的情况下死亡。 | 
| 示例 | 
|---|
| //Simple autokiller bullet:
//如果在启用伤害的土地上与化身接触,这将在碰撞时立即“杀死”。
 
default
{
    on_rez(integer param) // 当rezzed时变得活跃。
    {
        llSetDamage(100.0); // 将伤害设置为最大。
        llSensor("", "", AGENT, 96.0, PI); // 在96米范围内搜寻探员。
    }
    sensor(integer num) // If an agent is detected...
    {
        llSetStatus(STATUS_PHYSICS, TRUE); // 使物理允许物理运动。
        llSetTimerEvent(10.0); // Set a 10 second timer.
        llMoveToTarget(llDetectedPos(0), 0.5); //移动到检测到的位置.
    }
    no_sensor() // 如果没有检测到代理…
    {
        llDie(); // Auto destruct.
    }
    timer() // 如果我们没击中目标…
    {
        llDie(); // Auto destruct.
    }
}
 | 
| 相关函数 | 
|---|
| 无 | 
| 相关事件 | 
|---|
| 无 | 
