{"name":"setHitPointDamage","title":"setHitPointDamage","type":"command","url":"https://community.bistudio.com/wiki/setHitPointDamage","revid":369857,"updated":"2024-10-16T13:52:06Z","groups":["Object Manipulation"],"status":"ok","games":{"tkoh":"1.00","arma3":"0.50"},"since":"tkoh 1.00","arma3_since":"0.50","locality":{"argument":"local","effect":"global"},"description":"| Event Handler | Triggered |\n|---|---|\n| `Hit` | ✗ |\n| `HandleDamage` | ✗ |\n| `Killed` | ✓ |\n| `MPKilled` | ✓ |\n\nSet the current level of damage for a specific Hit Point (specified by its config class). This command has no effect when allowDamage is set to false.\n\n> [!NOTE]\n> See also BIS_fnc_setHitPointDamage for setting hit with dependency.","syntaxes":[{"syntax":"vehicle setHitPointDamage [hitPointName, damage, useEffects, killer, instigator, breakRotor]","params":[{"name":"vehicle","type":"Object","description":"vehicle to be damaged","type_expr":"Object"},{"name":"hitPointName","type":"String","description":"name of the Hit Point class","type_expr":"String"},{"name":"damage","type":"Number","description":"level of damage, in range 0..1","type_expr":"Number"},{"name":"useEffects","type":"Boolean","optional":true,"default":"true","description":"false to skip destruction effects","type_expr":"Boolean","since":"arma3 1.68","text":"useEffects: Boolean - (Optional, default true) false to skip destruction effects"},{"name":"killer","type":"Object","optional":true,"default":"objNull","description":"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.\n\n- It can be used to show \"killed by player\" in debriefing statistics and kill messages in the chat (if death messages are enabled).\n- It will alter the killer's rating as if the killer directly killed the unit.\n- It will be listed as `_killer` parameter in the Killed event handler.","type_expr":"Object","since":"arma3 2.08","text":"killer: Object - (Optional, default objNull) 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.\n\n- It can be used to show \"killed by player\" in debriefing statistics and kill messages in the chat (if death messages are enabled).\n- It will alter the killer's rating as if the killer directly killed the unit.\n- It will be listed as `_killer` parameter in the Killed event handler."},{"name":"instigator","type":"Object","optional":true,"default":"objNull","description":"the person that instigated the damage.\n\n- if a tank is a killer, the tank gunner that pulled the trigger is instigator\n- it will be listed as `_instigator` parameter in the Killed event handler.","type_expr":"Object","since":"arma3 2.12","text":"instigator: Object - (Optional, default objNull) the person that instigated the damage.\n\n- if a tank is a killer, the tank gunner that pulled the trigger is instigator\n- it will be listed as `_instigator` parameter in the Killed event handler."},{"name":"breakRotor","type":"Boolean","optional":true,"default":"false","description":"if the hitpoint is rotor on a helicopter, true will break the rotor as well as play corresponding sound if 'useEffects' is also true.","type_expr":"Boolean","since":"arma3 2.18","text":"breakRotor: Boolean - (Optional, default false) if the hitpoint is rotor on a helicopter, true will break the rotor as well as play corresponding sound if 'useEffects' is also true."}],"returns":{"type":"Nothing","type_expr":"Nothing"},"form":"binary","left":{"text":"vehicle"},"right":{"text":"[hitPointName, damage, useEffects, killer, instigator, breakRotor]"}}],"examples":[{"code":["vehicle player setHitPointDamage [\"hitEngine2\", 1.0];"]},{"code":["player setHitPointDamage [\"hitHead\", 0.5];\nplayer setHitPointDamage [\"hitBody\", 0.5];\nplayer setHitPointDamage [\"hitHands\", 0.5];\nplayer setHitPointDamage [\"hitLegs\", 0.5];"]}],"see_also":["getHitPointDamage","getAllHitPointsDamage","setHit","getHit","setDamage","damage","getHitIndex","setHitIndex","forceHitPointsDamageSync","BIS_fnc_setHitPointDamage"],"notes":[{"user":"Master85","date":"2012-08-30T13:54:00Z","text":"This command is using the Hit Points (defined in the `HitPoints` class in the config) while setHit is using Named Selections (defined in the model itself)."}]}