{"name":"allowDamage","operator":null,"title":"allowDamage","type":"command","url":"https://community.bistudio.com/wiki/allowDamage","revid":378125,"updated":"2026-02-21T14:29:34Z","groups":["Object Manipulation"],"status":"ok","replaced_by":[],"games":[{"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":"arma2","name":"Arma 2","version":"1.00"},"arma3_since":"0.50","branch":null,"locality":{"argument":"local","effect":"global","server_exec":false},"exec":null,"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","since":null,"effect":null,"exec":null,"params":[{"name":"entity","type":"Object","optional":false,"default":null,"description":null,"types":["Object"],"since":null,"text":"entity: Object"},{"name":"allow","type":"Boolean","optional":false,"default":null,"description":null,"types":["Boolean"],"since":null,"text":"allow: Boolean"}],"returns":{"type":"Nothing","types":["Nothing"],"description":null,"text":"Nothing"},"form":"binary","operator":null,"left":{"text":"entity","types":["Object"]},"right":{"text":"allow","types":["Boolean"]}}],"examples":[{"text":"```sqf\nplayer allowDamage false;\n```","code":["player allowDamage false;"]}],"multiplayer":"> [!IMPORTANT]\n> This command has to be executed where the object is local.\n> Its effect will only last as long as the object does not change locality.\n> If the object changes locality, the command needs to be executed again on the new owner's machine to maintain the effect.","problems":null,"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."}],"categories":["Arma 2: New Scripting Commands","Arma 2: Operation Arrowhead: Scripting Commands","Arma 2: Scripting Commands","Arma 3: Scripting Commands","Command Group: Object Manipulation","Introduced with Arma 2 version 1.00","Scripting Commands","Scripting Commands: Global Effect","Take On Helicopters: Scripting Commands"]}