ward1591 10 Posted November 27, 2014 (edited) So i used this same format on other building doors which have worked but it doesn't seem to work with the cargo tower doors anyone know why? ((nearestObjects [crypticbase1, ["Land_Cargo_Tower_V3_F"], 10]) select 0) setVariable ['bis_disabled_Door_1',1,true]; ((nearestObjects [crypticbase1, ["Land_Cargo_Tower_V3_F"], 10]) select 0) setVariable ['bis_disabled_Door_2',1,true]; ((nearestObjects [crypticbase1, ["Land_Cargo_Tower_V3_F"], 10]) select 0) setVariable ['bis_disabled_Door_3',1,true]; ((nearestObjects [crypticbase1, ["Land_Cargo_Tower_V3_F"], 10]) select 0) setVariable ['bis_disabled_Door_4',1,true]; Edited November 27, 2014 by ward1591 Share this post Link to post Share on other sites
Tajin 349 Posted November 28, 2014 I've just checked the config. The cargotower should act no different than the other BIS buildings. Have you checked if your "nearestObjects" actually returns something ? Also: 1. don't run "nearestObjects" 4 times when you could just save it in a variable and run it once. 2. if you just need the closest object, use nearestObject instead of nearestObjects and remove the "select 0". Oh and if you want, simply use my following function: eed_lockDoors = { private ["_building","_class","_num","_lockchance","_var","_anim"]; _building = [_this, 0, objNull, [ objNull ]] call BIS_fnc_param; if ( isNull _building ) exitWith { false }; _class = configFile >> "CfgVehicles" >> typeOf _building; _num = getNumber (_class >> "numberofdoors"); for "_i" from 1 to _num do { if (random 100 < _lockchance) then { _var = format ["bis_disabled_Door_%1", _i]; _anim = format ["Door_%1_rot", _i]; _building animate[_anim, 0]; _building setVariable[_var,1,true]; }; }; true }; execute it like this: [ somebuilding, "fnc_lockDoors", true, true] spawn BIS_fnc_MP; or this, in your case: [ ( (getPosATL crypticbase1) nearestObject "Land_Cargo_Tower_V3_F" ), "fnc_lockDoors", true, true] spawn BIS_fnc_MP; Share this post Link to post Share on other sites