{"name":"BIS_fnc_selectRandom","operator":null,"title":"BIS fnc selectRandom","type":"function","url":"https://community.bistudio.com/wiki/BIS_fnc_selectRandom","revid":348921,"updated":"2023-11-08T14:44:05Z","groups":["Arrays"],"status":"ok","replaced_by":[],"games":[{"game":"arma2","name":"Arma 2","version":"1.00"},{"game":"arma2oa","name":"Arma 2: Operation Arrowhead","version":"1.50"},{"game":"tkoh","name":"Take On Helicopters","version":"1.00"},{"game":"arma3","name":"Arma 3","version":"0.50"}],"since":{"game":"arma2","name":"Arma 2","version":"1.00"},"arma3_since":"0.50","branch":null,"locality":{"argument":null,"effect":"local","server_exec":false},"exec":null,"description":"Selects one of the arguments at random.\n\n> [!NOTE]\n> **Arma 3:** Use selectRandom instead.","syntaxes":[{"syntax":"values call BIS_fnc_selectRandom","since":null,"effect":null,"exec":null,"params":[{"name":"values","type":"Array","optional":false,"default":null,"description":"array of values of which one will be selected at random","types":["Array"],"since":null,"text":"values: Array - array of values of which one will be selected at random"}],"returns":{"type":"Anything","types":["Anything"],"description":"one of the values you passed, chosen at random","text":"Anything - one of the values you passed, chosen at random"}}],"examples":[{"text":"```sqf\nprivate _bestShooter = [_rento, _ben, _trit] call BIS_fnc_selectRandom; // returns one of the variables\n_bestSeries = [[\"halo1\",\"halo2\"],[\"ofp\",\"arma2\"]] call BIS_fnc_selectRandom; // returns one of the arrays\n```","code":["private _bestShooter = [_rento, _ben, _trit] call BIS_fnc_selectRandom; // returns one of the variables\n_bestSeries = [[\"halo1\",\"halo2\"],[\"ofp\",\"arma2\"]] call BIS_fnc_selectRandom; // returns one of the arrays"]}],"multiplayer":null,"problems":null,"aliases":[],"see_also":["selectRandom"],"notes":[],"categories":["Arma 2: Functions","Arma 2: New Functions","Arma 2: Operation Arrowhead: Functions","Arma 3: Functions","Function Group: Arrays","Functions","Functions: Local Effect","Introduced with Arma 2 version 1.00","Take On Helicopters: Functions"],"docblock":null,"filled_from_docblock":[]}