Nana1999 5 Posted June 28, 2018 Hello everyone, I added a sound script in the task file, there are several audio files, I only know that "call BIS_fnc_selectRandom;" can be played at random, but I hope to play it in order in the game, I do not know the specific command What is it? I searched Google for a lot of web pages but didn't get what I wanted. I hope everyone can give me help. Thank you! 1 Share this post Link to post Share on other sites
Grumpy Old Man 3546 Posted June 28, 2018 7 hours ago, SakamaKiRyo said: Hello everyone, I added a sound script in the task file, there are several audio files, I only know that "call BIS_fnc_selectRandom;" can be played at random, but I hope to play it in order in the game, I do not know the specific command What is it? I searched Google for a lot of web pages but didn't get what I wanted. I hope everyone can give me help. Thank you! This should get you started, best run this in initServer.sqf so every player gets the same song, should work in MP: //initServer.sqf //init song array GOM_songs = ["Song1","Song2","Song3"]; publicVariable "GOM_songs"; //define function once GOM_fnc_getNextElement = { params ["_array"]; _element = _array # (_array pushback (_array deleteAt 0)); publicVariable "_array"; _element }; //pick the first song, then put it in the back, so the second song will be next _currentSong = [GOM_songs] call GOM_fnc_getNextElement; systemchat format ["Current: %1",_currentSong]; systemchat format ["Next: %1",GOM_songs#0]; Edit: forgot that deleteAt returns the deleted element, adjusted it Cheers 1 1 Share this post Link to post Share on other sites
HazJ 1289 Posted June 29, 2018 I also recommend you use engine solution command: https://community.bistudio.com/wiki/selectRandom Share this post Link to post Share on other sites