CBA_fnc_selectRandomArray

Description

Select a specified amount of elements from an array without picking the same element multiple times.

Parameters

_arrayInput Array ARRAY
_amountAmount to select <NUMBER>

Returns

New array with the specified amount of randomly selected elements ARRAY

Example

_result = [[1, 2, 3, 4, 5], 2] call CBA_fnc_selectRandomArray;
// _result => [2, 4] (random)

Author

NeilZar

Array to read from [Array]
Close