Arma 3 Scripting

Command in Object Manipulation

setHit

Also available as Markdown and JSON, or read the original wiki page.

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

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

Parameters:

Returns: Nothing

Examples

Example 1

vehicle player setHit ["motor", 1];

Example 2

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

Example 3

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 · getHitPointDamage · setHitPointDamage · damage · setDamage · setFuel · setAmmo · getHitIndex · setHitIndex · forceHitPointsDamageSync

Community notes

Deadfast

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

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

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

_MH60S setHit ["elektronika", _hit];

should be used:

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