Advertisement
Jym_Nova

CD 9sec Clips

Jul 17th, 2015
532
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. // Written By: Ĵyм Ѡҩℓƒ (Jym Resident)
  2. /*
  3. LICENCE:
  4. This program is free software: you can redistribute it and/or modify
  5. it under the terms of the GNU General Public License as published by
  6. the Free Software Foundation, either version 3 of the License, or
  7. any later version.
  8.  
  9. This program is distributed in the hope that it will be useful,
  10. but WITHOUT ANY WARRANTY; without even the implied warranty of
  11. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  12. GNU General Public License for more details.
  13.  
  14. You should have received a copy of the GNU General Public License
  15. along with this program.  If not, see <http://www.gnu.org/licenses/>.
  16. or you may visit - http://license.idjhost.com/
  17. */
  18. // DESCRIPTION
  19. // Play 9 second sounds back to back with preloaded sound for no interruption
  20.  
  21. list invlist;
  22. integer tottrack;
  23. integer i;
  24. integer play = FALSE;
  25.  
  26. sound()
  27. {
  28.         llSetTimerEvent(9.0);
  29.         tottrack = llGetInventoryNumber(INVENTORY_SOUND);
  30.         float length = tottrack*9.0;
  31.         llSay(0, (string)length);
  32.         llPreloadSound(llGetInventoryName(INVENTORY_SOUND, 0));
  33.         i=0;
  34. }
  35.  
  36. default
  37. {
  38.     touch_start(integer total_number)
  39.     {
  40.         if (play)
  41.         {  
  42.             sound();
  43.         }
  44.         else
  45.         {
  46.             llSetTimerEvent(0.0);
  47.         }
  48.        
  49.         play = !play;
  50.     }
  51.     timer()
  52.     {
  53.         llTriggerSound(llGetInventoryName(INVENTORY_SOUND, i), 100.0);
  54.         i++;
  55.         if(i+1 < tottrack )
  56.         {
  57.             llPreloadSound(llGetInventoryName(INVENTORY_SOUND, i+1));
  58.         }
  59.         if(i == tottrack )
  60.         {
  61.             llResetScript();
  62.         }
  63.     }
  64. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement