{"name":"BIS_fnc_createRuin","operator":null,"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","replaced_by":[],"games":[{"game":"arma3","name":"Arma 3","version":"1.76"}],"since":{"game":"arma3","name":"Arma 3","version":"1.76"},"arma3_since":"1.76","branch":null,"locality":{"argument":null,"effect":null,"server_exec":false},"exec":null,"description":"Create a building ruin and hide the original object.","syntaxes":[{"syntax":"building call BIS_fnc_createRuin","since":null,"effect":null,"exec":null,"params":[{"name":"building","type":"Object","optional":false,"default":null,"description":"building to \"destroy\"","types":["Object"],"since":null,"text":"building: Object - building to \"destroy\""}],"returns":{"type":"Object","types":["Object"],"description":"the created ruin","text":"Object - the created ruin"}}],"examples":[{"text":"```sqf\naBuilding call BIS_fnc_createRuin;\n```","code":["aBuilding call BIS_fnc_createRuin;"]},{"text":"```sqf\n// 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;\n```","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;"]}],"multiplayer":null,"problems":null,"aliases":[],"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."}],"categories":["Arma 3: Functions","Arma 3: New Functions","Function Group: Environment","Functions","Introduced with Arma 3 version 1.76"],"docblock":null,"filled_from_docblock":[]}