Difference between revisions of "LlSetDamage"
Jump to navigation
Jump to search
m (LSL llSetDamage moved to LlSetDamage) |
(Added Example) |
||
Line 9: | Line 9: | ||
|caveats | |caveats | ||
|constants | |constants | ||
|examples | |examples= | ||
<pre> | |||
//Simple autokiller bullet: | |||
//When it rezed it scans for the closest person, | |||
//Moves to their location and kills them. (Because | |||
//It colides with them) | |||
default { | |||
on_rez(integer i) { | |||
llSetTimerEvent(10); | |||
llSetDamage(1000.0); | |||
llSensor("", "", AGENT, 100000, 10000); | |||
} | |||
timer() { llDie(); | |||
sensor(integer num) { | |||
while (1) | |||
llSetPos(llDetectedPos(i)); | |||
} | |||
}</pre> | |||
|helpers | |helpers | ||
|also_functions | |also_functions |
Revision as of 15:02, 12 October 2007
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
//Simple autokiller bullet: //When it rezed it scans for the closest person, //Moves to their location and kills them. (Because //It colides with them) default { on_rez(integer i) { llSetTimerEvent(10); llSetDamage(1000.0); llSensor("", "", AGENT, 100000, 10000); } timer() { llDie(); sensor(integer num) { while (1) llSetPos(llDetectedPos(i)); } }