Advertisement
Guest User

Untitled

a guest
Oct 14th, 2018
140
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. list daySounds = ["wren", "thrush", "blackbird", "robin_w", "Hsparrow", "Bluetit"];
  2. list nightSounds = ["Tawny Owl", "shortear owl","42917__inchadney__Owl"];
  3. float gVolume = 1;
  4. list nightAmbient = ["wind"];
  5.  
  6. default {
  7.     state_entry() {
  8.         llStopSound();
  9.         llSetTimerEvent(0.5);
  10.     }
  11.  
  12.     timer() {
  13.         vector time = llGetSunDirection();
  14.         list myList;
  15.         float density = 0.9;
  16.  
  17.         if (time.z > 0.0) {
  18.             myList = llListRandomize(daySounds, 1);
  19.         } else {
  20.             myList = llListRandomize(nightSounds, 1);
  21.             density = 0.98;
  22.            
  23.             // Ambient nighttime sound
  24.             if (llFrand(1.0) > 0.85) {
  25.                 llStopSound();
  26.             } else {
  27.                 llLoopSound(llList2String(nightAmbient, 0), gVolume);
  28.             }
  29.         }
  30.        
  31.         if (llFrand(1.0) > density) {
  32.             llTriggerSound(llList2String(myList, 0),gVolume);
  33.         }
  34.     }
  35. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement