samir17864 44 Posted July 21, 2023 Hello everyone, I am trying to run a small script only after the player close the Virtual Garage display ... How to check if the user closed the Virtual Garage display? https://community.bistudio.com/wiki/BIS_fnc_garage Share this post Link to post Share on other sites
Larrow 2822 Posted July 21, 2023 //initPlayerLocal.sqf [ missionNamespace, "garageClosed", { //Do something here } ] call BIS_fnc_addScriptedEventHandler; BIS_fnc_addScriptedEventHandler BI ScriptedEventHandlers 1 Share this post Link to post Share on other sites
samir17864 44 Posted July 21, 2023 I got it: _pos = player getPos [30,getDir player]; BIS_fnc_garage_center = createVehicle [ "Land_HelipadCircle_F", _pos, [], 0, "CAN_COLLIDE" ]; uinamespace setvariable ["bis_fnc_garage_defaultClass", "B_TargetSoldier" ]; ["Open",true] call BIS_fnc_garage; [missionNamespace, "garageClosed", {hint "Garage Closed";}] call BIS_fnc_addScriptedEventHandler; garageClosed is triggered when the Virtual Garage display is closed, and you can run whatever script you want ( in the above example hint "Garage Closed";) Oh, by the way the 3rd line (uinamespace setvariable ["bis_fnc_garage_defaultClass", "B_TargetSoldier" ];) will make the Virtual Garage open without adding any vehicle when it is first open, because the garage default class is set to something not available in the garage. Share this post Link to post Share on other sites