---
name: "setHit"
type: command
status: ok
groups: ["Object Manipulation"]
arma3_since: "0.50"
locality: {"argument": "local", "effect": "global", "server_exec": false}
source: https://community.bistudio.com/wiki/setHit
revid: 369851
updated: 2024-10-16T13:52:03Z
---

# setHit

*Command · Object Manipulation · Arma 3 v0.50 · introduced in Arma 2 v1.00*

Locality: arguments **local** · effect **global**

## Description

|  |  |  |
|---|---|---|
| + | Event Handler | Triggered |
| `Hit` | ✗ |  |
| `HandleDamage` | ✗ |  |
| `Killed` | ✓ |  |
| `MPKilled` | ✓ |  |

Set damage on a part of an object.

> [!NOTE]
> Some part names are in Czech; see the translation table.

## Syntax

```sqf
object setHit [part, damage, useEffects, killer, instigator, breakRotor]
```

**Parameters:**

- `object`: [Object](../topics/Object.md) - [local](../commands/local.md) object
- `part`: [String](../topics/String.md) - name of the part (selection name)
- `damage`: [Number](../topics/Number.md) - damage value ranging 0..1, 0 being fully functional, 1 being destroyed
- `useEffects`: [Boolean](../topics/Boolean.md) - (Optional, default [true](../commands/true.md)) [false](../commands/false.md) to skip destruction effects *(since arma3 1.68)*
- `killer`: [Object](../topics/Object.md) - (Optional, default [objNull](../commands/objNull.md)) the entity that caused the damage. If the damage leads to the death of the unit, the killer will be used as the object that caused the kill.
  - it can be used to show "killed by player" in debriefing statistics and kill messages in the chat (if death messages are enabled).
  - it will alter the killer's [rating](../commands/rating.md) as if the killer directly killed the unit.
  - it will be listed as `_killer` parameter in the [Killed](../topics/Event_Handlers.md#killed) event handler. *(since arma3 2.08)*
- `instigator`: [Object](../topics/Object.md) - (Optional, default [objNull](../commands/objNull.md)) the person that instigated the damage.
  - if a tank is a killer, the tank gunner that pulled the trigger is instigator
  - it will be listed as `_instigator` parameter in the [Killed](../topics/Event_Handlers.md#killed) event handler. *(since arma3 2.12)*
- `breakRotor`: [Boolean](../topics/Boolean.md) - (Optional, default [false](../commands/false.md)) if the hitpoint is rotor on a helicopter, [true](../commands/true.md) will break the rotor as well as play corresponding sound if 'useEffects' is also [true](../commands/true.md). *(since arma3 2.18)*

**Returns:** [Nothing](../topics/Nothing.md)

## Examples

### Example 1

```sqf
vehicle player setHit ["motor", 1];
```

### Example 2

```sqf
vehicle player setHit ["mala vrtule", 0.95];
```

### Example 3

```sqf
if (local _heli) then
{
    _heli setHit ["velka vrtule", 0];
}
else
{
    hint ("Vehicle " + str _heli + " must be local to this machine to do that!");
};
```

## See also

[getHit](../commands/getHit.md) · [getHitPointDamage](../commands/getHitPointDamage.md) · [setHitPointDamage](../commands/setHitPointDamage.md) · [damage](../commands/damage.md) · [setDamage](../commands/setDamage.md) · [setFuel](../commands/setFuel.md) · [setAmmo](../commands/setAmmo.md) · [getHitIndex](../commands/getHitIndex.md) · [setHitIndex](../commands/setHitIndex.md) · [forceHitPointsDamageSync](../commands/forceHitPointsDamageSync.md)

## Community notes

**Deadfast** — 2009-08-24

Damaging specific parts of the vehicle will not update its overall [damage](../commands/damage.md) value (as of v1.03):

```sqf
player setHit ["hands", 0.9];
hint str (damage player); // will return 0
```

---

**DenV** — 2011-03-29

Direct use of the names of sections of the model is likely a bad practice, and will not work on some addons.
So instead:

```sqf
_MH60S setHit ["elektronika", _hit];
```

should be used:

```sqf
_MH60S setHit [getText (configFile >> "cfgVehicles" >> "MH60S" >> "HitPoints" >> "HitAvionics" >> "name"), _hit];
```

<sub>Source: [BI Community Wiki — setHit](https://community.bistudio.com/wiki/setHit) (revision 369851).</sub>
