Difference between revisions of "LlSetDamage"

From Second Life Wiki
Jump to: navigation, search
m (lsl code tagging)
m
Line 3: Line 3:
 
|sort=SetDamage
 
|sort=SetDamage
 
|func=llSetDamage|p1_type=float|p1_name=damage
 
|func=llSetDamage|p1_type=float|p1_name=damage
|func_footnote=If '''damage''' is greater then 100.0, it will kill the agent it hits. If the object hits another object it will {{LSLG|llDie|die}}.
+
|func_footnote=If '''damage''' is greater then 100.0, it will [[death|kill]] the agent it hits. If the object hits another object it will [[llDie|die]].
 
|func_desc=Sets the amount of damage that will be done when this object hits an agent.
 
|func_desc=Sets the amount of damage that will be done when this object hits an agent.
 
|return_text
 
|return_text

Revision as of 15:50, 3 May 2009

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

<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>

Deep Notes

Search JIRA for related Issues

Signature

function void llSetDamage( float damage );