# llDamage

*LSL function*

```lsl
void llDamage(key target, float damage, integer damage_type);
```

- `key target`: Key of the target avatar or task to receive damage.
- `float damage`: Amount of damage to inflict (can exceed 100, unlike collision-based damage).
- `integer damage_type`: Type of damage to deliver to the target (can correspond to a DAMAGE_TYPE_* constant).

- Energy: 10

Generates a damage event delivering the specified amount of damage and damage_type to the targeted avatar or task in the same region.

This function delivers damage to tasks and agent in the same region.

```lsl title="How to use" frame="terminal"
llDamage(NULL_KEY, 0.0, 0);
```

## Specification

The `llDamage` function triggers a damage event on the targeted task. If any scripts in the target process the [on_damage](/events/on_damage/) event, they will be fired before the damage is applied or distributed.

| Flag |  | Description |
| --- | --- | --- |
| [DAMAGE_TYPE_IMPACT](/constants/DAMAGE_TYPE_IMPACT/) | −1 | System damage generated by impact with terrain or a prim. |
| [DAMAGE_TYPE_GENERIC](/constants/DAMAGE_TYPE_GENERIC/) | 0 | Generic or legacy damage. |
| [DAMAGE_TYPE_ACID](/constants/DAMAGE_TYPE_ACID/) | 1 | Damage caused by a caustic substance, such as acid. |
| [DAMAGE_TYPE_BLUDGEONING](/constants/DAMAGE_TYPE_BLUDGEONING/) | 2 | Damage caused by a blunt object, such as a club. |
| [DAMAGE_TYPE_COLD](/constants/DAMAGE_TYPE_COLD/) | 3 | Damage inflicted by exposure to extreme cold. |
| [DAMAGE_TYPE_ELECTRIC](/constants/DAMAGE_TYPE_ELECTRIC/) | 4 | Damage caused by electricity. |
| [DAMAGE_TYPE_FIRE](/constants/DAMAGE_TYPE_FIRE/) | 5 | Damage inflicted by exposure to heat or flames. |
| [DAMAGE_TYPE_FORCE](/constants/DAMAGE_TYPE_FORCE/) | 6 | Damage inflicted by a great force or impact. |
| [DAMAGE_TYPE_NECROTIC](/constants/DAMAGE_TYPE_NECROTIC/) | 7 | Damage caused by a direct assault on life-force. |
| [DAMAGE_TYPE_PIERCING](/constants/DAMAGE_TYPE_PIERCING/) | 8 | Damage caused by a piercing object such as a bullet, spear, or arrow. |
| [DAMAGE_TYPE_POISON](/constants/DAMAGE_TYPE_POISON/) | 9 | Damage caused by poison. |
| [DAMAGE_TYPE_PSYCHIC](/constants/DAMAGE_TYPE_PSYCHIC/) | 10 | Damage caused by a direct assault on the mind. |
| [DAMAGE_TYPE_RADIANT](/constants/DAMAGE_TYPE_RADIANT/) | 11 | Damage caused by radiation or extreme light. |
| [DAMAGE_TYPE_SLASHING](/constants/DAMAGE_TYPE_SLASHING/) | 12 | Damage caused by a slashing object such as a sword or axe. |
| [DAMAGE_TYPE_SONIC](/constants/DAMAGE_TYPE_SONIC/) | 13 | Damage caused by loud noises, like a Crash Worship concert. |
| [DAMAGE_TYPE_EMOTIONAL](/constants/DAMAGE_TYPE_EMOTIONAL/) | 14 |  |

Damage types are provided as a convenience and a suggestion. Scripters are free to add custom ones for their own combat systems or repurpose the damage type fields.

To make it easy for the community to recognise and re-use custom damage types here is a table [that scripters can add onto](https://wiki.secondlife.com/wiki/Template:LSL_Constants/Custom_Damage_Types):

| Flag |  | Description | Subtype | Creator | System |
| --- | --- | --- | --- | --- | --- |
| [100](https://wiki.secondlife.com/wiki/nolink%3D%2A) | 100 | Negative damage to heal a wound, damaged limb, first aid, etc. Intended for generic healing of biological nature. Positive damage would be medical malpractice |  | [Nexii Malthus](https://wiki.secondlife.com/wiki/User:Nexii_Malthus) | [Vertical Sim](https://wiki.secondlife.com/wiki/User:Nexii_Malthus/Vertical_Sim) / [SLMC](https://wiki.secondlife.com/wiki/User:Nexii_Malthus/SLMC) |
| [101](https://wiki.secondlife.com/wiki/nolink%3D%2A) | 101 | Negative damage from repairing an object or something mechanical, welding torch or wrench on a vehicle/robot/mech, etc. Positive damage can be due to mistakes, low skill or sabotage. Intended for generic healing of non-biological nature (e.g. a mechanical tank or an electrical system) |  | [Nexii Malthus](https://wiki.secondlife.com/wiki/User:Nexii_Malthus) | [Vertical Sim](https://wiki.secondlife.com/wiki/User:Nexii_Malthus/Vertical_Sim) / [SLMC](https://wiki.secondlife.com/wiki/User:Nexii_Malthus/SLMC) |
| [102](https://wiki.secondlife.com/wiki/nolink%3D%2A) | 102 | Damage caused by an explosive blast, like a grenade | [DAMAGE_TYPE_FORCE](/constants/DAMAGE_TYPE_FORCE/) | [Nexii Malthus](https://wiki.secondlife.com/wiki/User:Nexii_Malthus) | [Vertical Sim](https://wiki.secondlife.com/wiki/User:Nexii_Malthus/Vertical_Sim) / [SLMC](https://wiki.secondlife.com/wiki/User:Nexii_Malthus/SLMC) |
| [103](https://wiki.secondlife.com/wiki/nolink%3D%2A) | 103 | Damage caused by crushing. Such as being crushed by water pressure. More of a constant type of force damage — can be nullified/reduced via diving suit | [DAMAGE_TYPE_FORCE](/constants/DAMAGE_TYPE_FORCE/) | [Nexii Malthus](https://wiki.secondlife.com/wiki/User:Nexii_Malthus) | [Vertical Sim](https://wiki.secondlife.com/wiki/User:Nexii_Malthus/Vertical_Sim) / [SLMC](https://wiki.secondlife.com/wiki/User:Nexii_Malthus/SLMC) |
| [104](https://wiki.secondlife.com/wiki/nolink%3D%2A) | 104 | Damage caused by anti-tank/anti-armor. Such as from a specialised armor piercing shell, rocket or other munition | [DAMAGE_TYPE_PIERCING](/constants/DAMAGE_TYPE_PIERCING/) | [Nexii Malthus](https://wiki.secondlife.com/wiki/User:Nexii_Malthus) | [Vertical Sim](https://wiki.secondlife.com/wiki/User:Nexii_Malthus/Vertical_Sim) / [SLMC](https://wiki.secondlife.com/wiki/User:Nexii_Malthus/SLMC) |
| [105](https://wiki.secondlife.com/wiki/nolink%3D%2A) | 105 | Damage caused by suffocation. Usually lacking a breathable atmosphere, such as from drowning or being in the vacuum of space |  | [Nexii Malthus](https://wiki.secondlife.com/wiki/User:Nexii_Malthus) | [Vertical Sim](https://wiki.secondlife.com/wiki/User:Nexii_Malthus/Vertical_Sim) / [SLMC](https://wiki.secondlife.com/wiki/User:Nexii_Malthus/SLMC) |
| [106](https://wiki.secondlife.com/wiki/nolink%3D%2A) | 106 | Special damage to indicate combatant chose to redeploy. You can code in side effect(s) such as using up a ticket off the team to do so |  | [Nexii Malthus](https://wiki.secondlife.com/wiki/User:Nexii_Malthus) | [Vertical Sim](https://wiki.secondlife.com/wiki/User:Nexii_Malthus/Vertical_Sim) / [SLMC](https://wiki.secondlife.com/wiki/User:Nexii_Malthus/SLMC) |
| [200](https://wiki.secondlife.com/wiki/nolink%3D%2A) | 200 | Damage caused by lack of survival needs, such as starvation and dehydration. Negative damage used to heal through recovery by food and water |  | Adam Silver-Mane (Adamphillip) | Silver-mane's survival HUD |
| [201](https://wiki.secondlife.com/wiki/nolink%3D%2A) | 201 | Damage caused by active bleeding. Damage type check, sets health to 0 on unsustainable systemic failure |  | Adam Silver-Mane (Adamphillip) | Silver-mane's survival HUD |

## Caveats

- Calls are throttled to a rate of ≤10/30sec per recipient. Exceptions are:
- Recipient is avatar of the attachment.
- Recipient is sitting on the object.
- Triggering the damage throttle will shout an error to the debug channel and the script will continue running.
- The prim containing the script and the prim receiving the damage must both be in damage enable parcels.
- Targeting a seated avatar will redirect damage to the object the avatar is sitting on.

The [on_damage](/events/on_damage/) event will NOT be triggered if the source of the damage is either:

- An attachment on the avatar.
- An object or vehicle that the avatar is sitting on.

[final_damage](/events/final_damage/) will be triggered as normal.

The damage throttle is skipped if:

- Damage is negative.
- The source is an attachment on the avatar.
- The source is an object that the avatar is sitting on.
- The source is an object owned by a parcel owner or land group.

## See also

### Functions

- [llDetectedDamage](/functions/llDetectedDamage/)
- [llAdjustDamage](/functions/llAdjustDamage/)

### Events

- [on_damage](/events/on_damage/)
- [final_damage](/events/final_damage/)

---

*Source: [LlDamage](https://wiki.secondlife.com/wiki/LlDamage) on the Second Life Wiki. Content from the Second Life Wiki articles LlDamage (revision 1217008, 2024-08-05), Template:LSL Constants/Custom Damage Types (revision 1218868, 2026-06-03) and Template:LSL Constants/Damage Types (revision 1216840, 2024-06-26), CC BY-SA 3.0.*

---

From lsl.dev: https://lsl.dev/functions/llDamage/
