Arma 3 Scripting

Function in Arrays

BIS_fnc_selectRandom

Also available as Markdown and JSON, or read the original wiki page.

Description

Selects one of the arguments at random.

Note

Arma 3: Use selectRandom instead.

Syntax

values call BIS_fnc_selectRandom

Parameters:

Returns: Anything - one of the values you passed, chosen at random

Examples

Example 1

private _bestShooter = [_rento, _ben, _trit] call BIS_fnc_selectRandom; // returns one of the variables
_bestSeries = [["halo1","halo2"],["ofp","arma2"]] call BIS_fnc_selectRandom; // returns one of the arrays

See also

selectRandom