Difference between revisions of "LlSetDamage"

From Second Life Wiki
Jump to: navigation, search
(Added Example)
(omg is this example a bad idea)
Line 14: Line 14:
 
//When it rezed it scans for the closest person,
 
//When it rezed it scans for the closest person,
 
//Moves to their location and kills them. (Because
 
//Moves to their location and kills them. (Because
//It colides with them)
+
//It collides with them)
 
default {
 
default {
 
+
    on_rez(integer i) {
    on_rez(integer i) {
+
        llSetTimerEvent(10.0);
          llSetTimerEvent(10);
+
        llSetDamage(10000.0);
          llSetDamage(1000.0);
+
        llSensor("", "", AGENT, PI, 96.0);
          llSensor("", "", AGENT, 100000, 10000);
+
    }
}
+
    timer() { llDie(); }
    timer() { llDie();
+
    sensor(integer num) {
    sensor(integer num) {
+
        for(num = 100;--num;)
          while (1)
+
            llSetPos(llDetectedPos(0));
              llSetPos(llDetectedPos(i));
+
    }
    }
+
 
}</pre>
 
}</pre>
 
|helpers
 
|helpers

Revision as of 10:38, 14 October 2007

Summary

Function: llSetDamage( float damage );

Sets the amount of damage that will be done when this object hits an agent.

• float damage

If damage is greater then 100.0, it will kill the agent it hits. If the object hits another object it will die.

Examples

//Simple autokiller bullet: 
//When it rezed it scans for the closest person,
//Moves to their location and kills them. (Because
//It collides with them)
default {
    on_rez(integer i) {
        llSetTimerEvent(10.0);
        llSetDamage(10000.0);
        llSensor("", "", AGENT, PI, 96.0);
    }
    timer() { llDie(); }
    sensor(integer num) {
        for(num = 100;--num;)
            llSetPos(llDetectedPos(0));
    }
}

Deep Notes

Search JIRA for related Issues

Signature

function void llSetDamage( float damage );