{"name":"allowDamage","title":"allowDamage","type":"command","url":"https://community.bistudio.com/wiki/allowDamage","revid":378125,"updated":"2026-02-21T14:29:34Z","groups":["Object Manipulation"],"status":"ok","games":{"arma2":"1.00","arma2oa":"1.50","tkoh":"1.00","arma3":"0.50"},"since":"arma2 1.00","arma3_since":"0.50","locality":{"argument":"local","effect":"global"},"description":"Enables / disables an entity's ability to receive damage.\nThis command does not prevent the entity from taking scripted damage from commands such as setDamage, setHit, setHitIndex or setHitPointDamage.\n\n> [!NOTE]\n> This command only supports entities (`Entity` is a child class of `Object`, i.e. all entities are objects, but not all objects are entities).\n> Consequently, there are objects that are not affected by this command, for example terrain vegetation such as trees.","syntaxes":[{"syntax":"entity allowDamage allow","params":[{"name":"entity","type":"Object","type_expr":"Object"},{"name":"allow","type":"Boolean","type_expr":"Boolean"}],"returns":{"type":"Nothing","type_expr":"Nothing"},"form":"binary","left":{"text":"entity"},"right":{"text":"allow"}}],"examples":[{"code":["player allowDamage false;"]}],"multiplayer":"> [!IMPORTANT]\n> This command has to be executed where the object is local.\n>\n> Its effect will only last as long as the object does not change locality.\n>\n> If the object changes locality, the command needs to be executed again on the new owner's machine to maintain the effect.","aliases":["allowDammage"],"see_also":["isDamageAllowed","setDamage","setHit","setHitIndex","setHitPointDamage","damage"],"notes":[{"user":"AgentRev01","date":"2013-09-02T18:26:00Z","text":"```sqf\n_object allowDamage false;\n```\n\nhas the same effect as\n\n```sqf\n_object addEventHandler [\"HandleDamage\", { 0 }];\n```\n\n**except for buildings that are native to the map**; for those, the effects of HandleDamage will not sync properly across all clients, even if added to the building on every client and the server."}]}