DiaZ35 4 Posted December 20, 2020 As, tite says. How I can easly make this script a loop? playSound3D ["a3\music_f_mark\music\leadtrack01_f_mark.ogg", r1, false, getPos r1, 10, 1, 50]; Share this post Link to post Share on other sites
johnnyboy 3797 Posted December 20, 2020 while {true} do { playSound3D ["a3\music_f_mark\music\leadtrack01_f_mark.ogg", r1, false, getPos r1, 10, 1, 50]; sleep 30; // Change this to however many seconds the sound file is. }; 2 Share this post Link to post Share on other sites
pierremgi 4906 Posted December 21, 2020 duration 2:38 You can see that, running: utils4 in debug console. The tracks are ordered by addons, so find music_f_mark then your track. 2 Share this post Link to post Share on other sites
DiaZ35 4 Posted December 22, 2020 @johnnyboy When I apply this script to a radio, the music is very loud and plays several songs at once and the music does not loop. Share this post Link to post Share on other sites
pierremgi 4906 Posted December 22, 2020 50 minutes ago, DiaZ35 said: @johnnyboy When I apply this script to a radio, the music is very loud and plays several songs at once and the music does not loop. which code you run exactly? Share this post Link to post Share on other sites
DiaZ35 4 Posted December 22, 2020 @pierremgi https://imgur.com/GQm6CGM Share this post Link to post Share on other sites
pierremgi 4906 Posted December 22, 2020 Normal. I'm surprised you didn't crash to desktop. The init field of an object/unit is unscheduled. The code can't support a sleep or a waitUntil condition. You must spawn or execVM that. You need to write: 0 = [] spawn { while {true} do { playSound3D ["a3\music_f_mark\music\leadtrack01_f_mark.ogg", r1, false, getPos r1, 10, 1, 50]; sleep 158; }; }; 5 Share this post Link to post Share on other sites
DiaZ35 4 Posted December 23, 2020 Yes, I actually got a crash to my desktop a few times, but then I managed to start this up to experience this bug. Thanks a lot for your help. 1 Share this post Link to post Share on other sites
DiaZ35 4 Posted December 23, 2020 I have a new question. Is it possible to set several songs in this script that will loop? Share this post Link to post Share on other sites
iSassafras 6 Posted December 24, 2020 Hey man, that's possible! 🙂 You just need to add more "playSound3D" lines into the loop for each track you would like to play and keep in mind to add a "sleep" command after each of them. The number after sleep is the time in seconds the loop should wait before continuing, in this case you should at least let it sleep for the duration of the previous track. 1 1 Share this post Link to post Share on other sites