{"name":"BIS_fnc_createRuin","title":"BIS fnc createRuin","type":"function","url":"https://community.bistudio.com/wiki/BIS_fnc_createRuin","revid":347313,"updated":"2023-09-10T15:21:43Z","groups":["Environment"],"status":"ok","games":{"arma3":"1.76"},"since":"arma3 1.76","arma3_since":"1.76","description":"Create a building ruin and hide the original object.","syntaxes":[{"syntax":"building call BIS_fnc_createRuin","params":[{"name":"building","type":"Object","description":"building to \"destroy\"","type_expr":"Object"}],"returns":{"type":"Object","type_expr":"Object","description":"the created ruin"}}],"examples":[{"code":["aBuilding call BIS_fnc_createRuin;"]},{"code":["// will destroy every building in a 50m radius around the player\nprivate _nearBuildings = player nearObjects [\"House\", 50];\n{ _x call BIS_fnc_createRuin } forEach _nearBuildings;"]}],"see_also":["setDamage"],"notes":[{"user":"Beno_83au","date":"2019-06-01T13:14:00Z","text":"In MP this function doesn't hide the building globally, so other clients will see both the original building *AND* the newly created ruined building - <https://feedback.bistudio.com/T140045>.\nTo get around this I've been hiding the object manually on all other clients:\n\n```sqf\n_building call BIS_fnc_createRuin;\n[_building, true] remoteExecCall [\"hideObject\", -clientOwner];\n```\n\nThis will run hideObject on all other clients besides the client (or server) that this was executed from."}]}