{"name":"setDamage","operator":null,"title":"setDamage","type":"command","url":"https://community.bistudio.com/wiki/setDamage","revid":378306,"updated":"2026-04-01T22:21:06Z","groups":["Object Manipulation"],"status":"ok","replaced_by":[],"games":[{"game":"ofp","name":"Operation Flashpoint","version":null},{"game":"arma1","name":"Armed Assault","version":"1.00"},{"game":"arma2","name":"Arma 2","version":"1.00"},{"game":"arma2oa","name":"Arma 2: Operation Arrowhead","version":"1.50"},{"game":"tkoh","name":"Take On Helicopters","version":"1.00"},{"game":"arma3","name":"Arma 3","version":"0.50"}],"since":{"game":"ofp","name":"Operation Flashpoint","version":null},"arma3_since":"0.50","branch":null,"locality":{"argument":"global","effect":"global","server_exec":false},"exec":null,"description":"|  |  |  |\n|---|---|---|\n| + | Event Handler | Triggered |\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","since":null,"effect":null,"exec":null,"params":[{"name":"object","type":"Object","optional":false,"default":null,"description":null,"types":["Object"],"since":null,"text":"object: Object"},{"name":"damage","type":"Number","optional":false,"default":null,"description":"range 0..1, 0 = pristine/healthy condition, 1 = entirely destroyed/killed","types":["Number"],"since":null,"text":"damage: Number - range 0..1, 0 = pristine/healthy condition, 1 = entirely destroyed/killed"}],"returns":{"type":"Nothing","types":["Nothing"],"description":null,"text":"Nothing"},"form":"binary","operator":null,"left":{"text":"object","types":["Object"]},"right":{"text":"damage","types":["Number"]}},{"syntax":"object setDamage [damage, useEffects, killer, instigator, allowResurrection]","since":"arma3 1.68","effect":null,"exec":null,"params":[{"name":"object","type":"Object","optional":false,"default":null,"description":null,"types":["Object"],"since":null,"text":"object: Object"},{"name":"damage","type":"Number","optional":false,"default":null,"description":"range 0..1, 0 = pristine/healthy condition, 1 = entirely destroyed/killed","types":["Number"],"since":null,"text":"damage: Number - range 0..1, 0 = pristine/healthy condition, 1 = entirely destroyed/killed"},{"name":"useEffects","type":"Boolean","optional":true,"default":"true","description":"false to skip destruction effects","types":["Boolean"],"since":null,"text":"useEffects: Boolean (Optional, default true) - false to skip destruction effects"},{"name":"Server Execution killer","type":"Object","optional":true,"default":"objNull","description":"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- 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","types":["Object"],"since":"arma3 2.12","text":"Server Execution killer: Object - (Optional, default objNull) 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- 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":"Server Execution instigator","type":"Object","optional":true,"default":"objNull","description":"the person that instigated the damage.\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","types":["Object"],"since":"arma3 2.12","text":"Server Execution instigator: Object - (Optional, default objNull) the person that instigated the damage.\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.","types":["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.","types":["Object"],"since":"arma3 2.22","text":"shot: Object - (Optional, default objNull) - shot that caused the damage."}],"returns":{"type":"Nothing","types":["Nothing"],"description":null,"text":"Nothing"},"form":"binary","operator":null,"left":{"text":"object","types":["Object"]},"right":{"text":"[damage, useEffects, killer, instigator, allowResurrection]","types":["Array"]}}],"examples":[{"text":"```sqf\n_soldier1 setDamage 1;\n```","code":["_soldier1 setDamage 1;"]},{"text":"```sqf\n_house1 setDamage [1, false];\n```","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)"]}],"multiplayer":null,"problems":null,"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```"}],"categories":["ArmA: Armed Assault: Scripting Commands","Arma 2: Operation Arrowhead: Scripting Commands","Arma 2: Scripting Commands","Arma 3: Scripting Commands","Command Group: Object Manipulation","Introduced with Operation Flashpoint version","Operation Flashpoint: New Scripting Commands","Operation Flashpoint: Scripting Commands","Scripting Commands","Scripting Commands: Global Effect","Take On Helicopters: Scripting Commands"]}