{"name":"BIS_fnc_countdown","operator":null,"title":"BIS fnc countdown","type":"function","url":"https://community.bistudio.com/wiki/BIS_fnc_countdown","revid":378252,"updated":"2026-03-25T14:24:56Z","groups":["Missions"],"status":"ok","replaced_by":[],"games":[{"game":"arma3","name":"Arma 3","version":"1.02"}],"since":{"game":"arma3","name":"Arma 3","version":"1.02"},"arma3_since":"1.02","branch":null,"locality":{"argument":null,"effect":null,"server_exec":false},"exec":null,"description":"Triggers a countdown.\n\n> [!NOTE]\n> The **initial** countdown can be accessed via missionNamespace's variable **BIS_fnc_countdown_time**.\n>\n> The initial value is either `serverTime + timeInSeconds` (if set globally) or `time + timeInSeconds` (if set locally).\n> To return the left-over time see #Example 4.","syntaxes":[{"syntax":"[timeInSeconds, global] call BIS_fnc_countdown","since":null,"effect":null,"exec":null,"params":[{"name":"timeInSeconds","type":"Number or Boolean:","optional":false,"default":null,"description":"Number or Boolean:\n- Number:\n  - Any number to set the length of the countdown in seconds\n  - -1 to set the countdown to nil\n  - 0 to return the left-over time\n- Boolean:\n  - true to find out if countdown is active and if there is left-over time","types":["Number","Boolean"],"since":null,"text":"timeInSeconds: Number or Boolean:\n- Number:\n  - Any number to set the length of the countdown in seconds\n  - -1 to set the countdown to nil\n  - 0 to return the left-over time\n- Boolean:\n  - true to find out if countdown is active and if there is left-over time"},{"name":"global","type":"Boolean","optional":true,"default":"true","description":"true to set it globally, false to set it locally","types":["Boolean"],"since":null,"text":"global: Boolean - (Optional, default true) true to set it globally, false to set it locally"}],"returns":{"type":"- Number:","types":[],"description":"If set locally: time + timeInSeconds (see #Example 1) - If set globally: serverTime + timeInSeconds (see #Example 2) - Returns -1 if countdown is set to nil (see #Example 3) - Return left-over time (see #Example 4) - Boolean: returns true when countdown is > 0 else false (see #Example 5)","text":"- Number:\n  - If set locally: time + timeInSeconds (see #Example 1)\n  - If set globally: serverTime + timeInSeconds (see #Example 2)\n  - Returns -1 if countdown is set to nil (see #Example 3)\n  - Return left-over time (see #Example 4)\n- Boolean: returns true when countdown is > 0 else false (see #Example 5)"}}],"examples":[{"text":"```sqf\nprivate _initialCountdown = [50, false] call BIS_fnc_countdown; // sets countdown to 50 seconds where function is executed\n```","code":["private _initialCountdown = [50, false] call BIS_fnc_countdown; // sets countdown to 50 seconds where function is executed"]},{"text":"```sqf\nprivate _initialCountdown = [50] call BIS_fnc_countdown; // sets countdown to 50 seconds globally\n```","code":["private _initialCountdown = [50] call BIS_fnc_countdown; // sets countdown to 50 seconds globally"]},{"text":"```sqf\n[-1] call BIS_fnc_countdown; // sets BIS_fnc_countdown_time to nil\n```","code":["[-1] call BIS_fnc_countdown; // sets BIS_fnc_countdown_time to nil"]},{"text":"```sqf\nprivate _timeLeft = [0] call BIS_fnc_countdown; // returns the left over-time\n```","code":["private _timeLeft = [0] call BIS_fnc_countdown; // returns the left over-time"]},{"text":"```sqf\nprivate _isTimeLeft = [true] call BIS_fnc_countdown; // returns true if countdown is greater than 0\n```","code":["private _isTimeLeft = [true] call BIS_fnc_countdown; // returns true if countdown is greater than 0"]}],"multiplayer":null,"problems":null,"aliases":[],"see_also":["BIS_fnc_VRTimer"],"notes":[],"categories":["Arma 3: Functions","Arma 3: New Functions","Function Group: Missions","Functions","Introduced with Arma 3 version 1.02"],"docblock":null,"filled_from_docblock":[]}