{"name":"selectRandom","operator":null,"title":"selectRandom","type":"command","url":"https://community.bistudio.com/wiki/selectRandom","revid":377101,"updated":"2026-01-01T09:58:32Z","groups":["Arrays"],"status":"ok","replaced_by":[],"games":[{"game":"arma3","name":"Arma 3","version":"1.56"}],"since":{"game":"arma3","name":"Arma 3","version":"1.56"},"arma3_since":"1.56","branch":null,"locality":{"argument":null,"effect":null,"server_exec":false},"exec":null,"description":"Returns a random element from the given array. Engine solution to BIS_fnc_selectRandom","syntaxes":[{"syntax":"selectRandom array","since":null,"effect":null,"exec":null,"params":[{"name":"array","type":"Array of Anything","optional":false,"default":null,"description":null,"types":["Array","Anything"],"since":null,"text":"array: Array of Anything"}],"returns":{"type":"Anything","types":["Anything"],"description":"random selected value or Nothing if array is empty","text":"Anything - random selected value or Nothing if array is empty"},"form":"unary","operator":null,"left":null,"right":{"text":"array","types":["Array","Anything"]}}],"examples":[{"text":"```sqf\n_randomElement = selectRandom [1,2,3,4,5];\n```","code":["_randomElement = selectRandom [1,2,3,4,5];"]}],"multiplayer":null,"problems":null,"aliases":[],"see_also":["selectRandomWeighted","random","select","selectMin","selectMax"],"notes":[],"categories":["Arma 3: New Scripting Commands","Arma 3: Scripting Commands","Command Group: Arrays","Introduced with Arma 3 version 1.56","Scripting Commands"]}