{"name":"setDamage","title":"setDamage","type":"command","url":"https://community.bistudio.com/wiki/setDamage","revid":379302,"updated":"2026-10-30T23:48:26Z","groups":["Object Manipulation"],"status":"ok","games":{"ofp":null,"arma1":"1.00","arma2":"1.00","arma2oa":"1.50","tkoh":"1.00","arma3":"0.50"},"since":"ofp","arma3_since":"0.50","locality":{"argument":"global","effect":"global"},"description":"| Event Handler | Triggered |\n|---|---|\n| `Hit` | ✗ |\n| `HandleDamage` | ✗ |\n| `Killed` | ✓ |\n| `MPKilled` | ✓ |\n\nSets the damage (or lack thereof) of an object/unit. The alternative syntax allows to skip destruction effects for vehicles and buildings and set a tree/pole/wall fall direction (away from *killer*).","syntaxes":[{"syntax":"object setDamage damage","params":[{"name":"object","type":"Object","type_expr":"Object"},{"name":"damage","type":"Number","description":"range 0..1, 0 = pristine/healthy condition, 1 = entirely destroyed/killed","type_expr":"Number"}],"returns":{"type":"Nothing","type_expr":"Nothing"},"form":"binary","left":{"text":"object"},"right":{"text":"damage"}},{"syntax":"object setDamage [damage, useEffects, killer, instigator, allowResurrection]","since":"arma3 1.68","params":[{"name":"object","type":"Object","type_expr":"Object"},{"name":"damage","type":"Number","description":"range 0..1, 0 = pristine/healthy condition, 1 = entirely destroyed/killed","type_expr":"Number"},{"name":"useEffects","type":"Boolean","optional":true,"default":"true","description":"false to skip destruction effects","type_expr":"Boolean","text":"useEffects: Boolean (Optional, default true) - false to skip destruction effects"},{"name":"killer","type":"Object","optional":true,"default":"objNull","description":"Server execution the entity that caused the damage (can be anything). 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\n- it influences a tree/pole/wall fall direction (it will fall *away* from *killer*)\n- *killer* is ignored if setDamage is called on a player client machine unless *object* is one of these three entity types - see Example 3\n- MP restricted similar to setShotParents, will be ignored unless executed on the server or headless client in MP","type_expr":"Object","since":"arma3 2.12","text":"killer: Object - (Optional, default objNull) Server execution the entity that caused the damage (can be anything). 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\n- it influences a tree/pole/wall fall direction (it will fall *away* from *killer*)\n- *killer* is ignored if setDamage is called on a player client machine unless *object* is one of these three entity types - see Example 3\n- MP restricted similar to setShotParents, will be ignored unless executed on the server or headless client in MP"},{"name":"instigator","type":"Object","optional":true,"default":"objNull","description":"Server execution 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\n- MP restricted similar to setShotParents, will be ignored unless executed on the server or headless client in MP\n  - the above MP restriction does not apply to trees, poles and walls","type_expr":"Object","since":"arma3 2.12","text":"instigator: Object - (Optional, default objNull) Server execution 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\n- MP restricted similar to setShotParents, will be ignored unless executed on the server or headless client in MP\n  - the above MP restriction does not apply to trees, poles and walls"},{"name":"allowResurrection","type":"Boolean","optional":true,"default":"false","description":"Will re-set alive state of previously dead object.","type_expr":"Boolean","since":"arma3 2.22","text":"allowResurrection: Boolean - (Optional, default false) - Will re-set alive state of previously dead object."},{"name":"shot","type":"Object","optional":true,"default":"objNull","description":"shot that caused the damage.","type_expr":"Object","since":"arma3 2.22","text":"shot: Object - (Optional, default objNull) - shot that caused the damage."}],"returns":{"type":"Nothing","type_expr":"Nothing"},"form":"binary","left":{"text":"object"},"right":{"text":"[damage, useEffects, killer, instigator, allowResurrection]"}}],"examples":[{"code":["_soldier1 setDamage 1;"]},{"code":["_house1 setDamage [1, false];"]},{"text":"```sqf\n// executed on a client\n_remoteVehicle setDamage [1, true, player];    // killer (here, player) is not considered if the command is not called on the server\n                                            // the vehicle still gets destroyed\n\n_tree setDamage [1, true, player];            // the tree is destroyed and falls away from the player\n_pole setDamage [1, true, player];            // these three cases are the only ones where killer is considered\n_wall setDamage [1, true, player];            // when setDamage is called on a non-server machine (neither server or headless client)\n```","code":["// executed on a client\n_remoteVehicle setDamage [1, true, player];\t// killer (here, player) is not considered if the command is not called on the server\n\t\t\t\t\t\t\t\t\t\t\t// the vehicle still gets destroyed\n\n_tree setDamage [1, true, player];\t\t\t// the tree is destroyed and falls away from the player\n_pole setDamage [1, true, player];\t\t\t// these three cases are the only ones where killer is considered\n_wall setDamage [1, true, player];\t\t\t// when setDamage is called on a non-server machine (neither server or headless client)"]}],"aliases":["setDammage"],"see_also":["setVehicleArmor","damage","setHit","getHit","getHitIndex","setHitIndex","getHitPointDamage","setHitPointDamage"],"notes":[{"user":"Fragorl","date":"2006-04-17T07:36:00Z","text":"In **Operation Flashpoint**, setting a unit's damage to a negative value will set it is health to full, but impair their aim."},{"user":"KamikazeXeX","date":"2015-05-29T11:23:00Z","text":"Using this possible overrides individual hit damages such as setHitPointDamage [\"HitHead\", _value]; if you're having issues try setting hitdamage *after* setdamage."},{"user":"Sarogahtyp","date":"2021-06-24T10:31:00Z","text":"You are able to repair buildings with this command if you just store the original object and use setDamage on this and not on the wreck which is shown after the building was destroyed. This works in debug console when pointing a house:\n\n```sqf\n0 spawn\n{\n    private _house = cursorObject;\n    _house setDamage 1;\n    sleep 5;\n    _house setDamage 0;\n};\n```"}]}