Guest User

Untitled

a guest
Jan 16th, 2019
136
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. string sound1 = "657d952b-ff78-bc4d-9b7c-6763639b8a18";  // length = 9.989
  2. string sound2 = "b84cd34b-1b16-3549-1c02-da1fb57d7b4a";  // length = 9.989
  3. string sound3 = "4215cb39-d345-7f56-f976-57e10027339a";  // length = 7.769  
  4.  
  5. integer play = 0;   // status-check-flag for checking which activity is running and then controlling the flow of activity
  6. float delay = 0.1;  // if u dont need this then make it 0.0 for no delay
  7.  
  8. default
  9. {
  10.     state_entry()
  11.     {
  12.         llPreloadSound(sound1);
  13.         llPreloadSound(sound2);
  14.         llPreloadSound(sound3);
  15.         llSetTimerEvent(0.01);
  16.     }
  17.  
  18.     timer()
  19.     {
  20.         string anim = llGetAnimation(llGetOwner());
  21.         if ((anim == "Walking") || (anim == "Running") || (anim == "Turning Left") || (anim == "Turning Right") || (anim == "CrouchWalking"))
  22.         {
  23.             if(play == 0)
  24.             {
  25.                 llResetTime();
  26.                 play = 1;
  27.             }
  28.             else if(play == 1)
  29.             {
  30.                 llPlaySound(sound1,1.0);
  31.                 play = 2;
  32.             }
  33.             else if(play == 2)
  34.             {
  35.                 if(llGetTime() > (9.989 - delay))
  36.                 {
  37.                     play = 3;
  38.                 }
  39.             }
  40.             else if(play == 3)
  41.             {
  42.                 llResetTime();
  43.                 llPlaySound(sound2,1.0);
  44.                 play = 4;                
  45.             }
  46.             else if(play == 4)
  47.             {
  48.                 if(llGetTime() >= (9.989 - delay))
  49.                 {
  50.                     play = 5;
  51.                 }
  52.             }
  53.             else if(play == 5)
  54.             {
  55.                 llResetTime();
  56.                 llPlaySound(sound3,1.0);
  57.                 play = 6;                
  58.             }
  59.             else if(play == 6)
  60.             {
  61.                 if(llGetTime() >= (7.769 - delay))
  62.                 {
  63.                     play = 0;
  64.                 }
  65.             }
  66.         }
  67.         else
  68.         {
  69.             llStopSound();
  70.             play = 0;
  71.         }
  72.     }
  73.    
  74.     on_rez(integer n)
  75.     {
  76.         llResetScript();
  77.     }
  78. }
Add Comment
Please, Sign In to add comment