Difference between revisions of "LlSetDamage"
Jump to navigation
Jump to search
(omg is this example a bad idea) |
m (lsl code tagging) |
||
Line 10: | Line 10: | ||
|constants | |constants | ||
|examples= | |examples= | ||
< | <lsl> | ||
//Simple autokiller bullet: | //Simple autokiller bullet: | ||
//When it | //When it rezzed it scans for the closest person, | ||
//Moves to their location and kills them. (Because | //Moves to their location and kills them. (Because | ||
//It collides with them) | //It collides with them) | ||
Line 26: | Line 26: | ||
llSetPos(llDetectedPos(0)); | llSetPos(llDetectedPos(0)); | ||
} | } | ||
}</ | }</lsl> | ||
|helpers | |helpers | ||
|also_functions | |also_functions |
Revision as of 08:25, 3 April 2008
LSL Portal | Functions | Events | Types | Operators | Constants | Flow Control | Script Library | Categorized Library | Tutorials |
Summary
Function: llSetDamage( float damage );157 | Function ID |
0.0 | Forced Delay |
10.0 | Energy |
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.
Caveats
Examples
<lsl> //Simple autokiller bullet: //When it rezzed 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)); }}</lsl>