Eidolon Aeon Posted October 7, 2021 Share Posted October 7, 2021 Hi all, I have an old school ambient sounds script that plays different sounds according to whether it is day or night. It's only supposed to loop crickets at night, but it plays the loop during the day as well. Other sounds play at the correct time. I'm not skilled enough to figure out what is going on with that and am hoping somebody can help. The chunk of code: { vector time = llGetSunDirection(); list myList; float density = 0.9; if (time.z > 0.0) { myList = llListRandomize(daySounds, 1); } else { myList = llListRandomize(nightSounds, 1); density = 0.98; // Ambient nighttime sound if (llFrand(1.0) > 0.85) { llStopSound(); } else { llLoopSound(llList2String(nightAmbient, 0), 1.0); } } if (llFrand(1.0) > density) { llTriggerSound(llList2String(myList, 0), 1.0); } Link to comment Share on other sites More sharing options...
Xiija Posted October 8, 2021 Share Posted October 8, 2021 if your function is on a timer, you mebbe need to clear your list each time? .. myList = [ ]; Link to comment Share on other sites More sharing options...
Eidolon Aeon Posted October 8, 2021 Author Share Posted October 8, 2021 It is on a timer, I'll try that. Thanks. Link to comment Share on other sites More sharing options...
Eidolon Aeon Posted October 8, 2021 Author Share Posted October 8, 2021 And it works, day and night! Thanks again! Link to comment Share on other sites More sharing options...
Recommended Posts
Please take a moment to consider if this thread is worth bumping.
Please sign in to comment
You will be able to leave a comment after signing in
Sign In Now