Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- string sound1 = "657d952b-ff78-bc4d-9b7c-6763639b8a18"; // length = 9.989
- string sound2 = "b84cd34b-1b16-3549-1c02-da1fb57d7b4a"; // length = 9.989
- string sound3 = "4215cb39-d345-7f56-f976-57e10027339a"; // length = 7.769
- integer play = 0; // status-check-flag for checking which activity is running and then controlling the flow of activity
- float delay = 0.1; // if u dont need this then make it 0.0 for no delay
- default
- {
- state_entry()
- {
- llPreloadSound(sound1);
- llPreloadSound(sound2);
- llPreloadSound(sound3);
- llSetTimerEvent(0.01);
- }
- timer()
- {
- string anim = llGetAnimation(llGetOwner());
- if ((anim == "Walking") || (anim == "Running") || (anim == "Turning Left") || (anim == "Turning Right") || (anim == "CrouchWalking"))
- {
- if(play == 0)
- {
- llResetTime();
- play = 1;
- }
- else if(play == 1)
- {
- llPlaySound(sound1,1.0);
- play = 2;
- }
- else if(play == 2)
- {
- if(llGetTime() > (9.989 - delay))
- {
- play = 3;
- }
- }
- else if(play == 3)
- {
- llResetTime();
- llPlaySound(sound2,1.0);
- play = 4;
- }
- else if(play == 4)
- {
- if(llGetTime() >= (9.989 - delay))
- {
- play = 5;
- }
- }
- else if(play == 5)
- {
- llResetTime();
- llPlaySound(sound3,1.0);
- play = 6;
- }
- else if(play == 6)
- {
- if(llGetTime() >= (7.769 - delay))
- {
- play = 0;
- }
- }
- }
- else
- {
- llStopSound();
- play = 0;
- }
- }
- on_rez(integer n)
- {
- llResetScript();
- }
- }
Add Comment
Please, Sign In to add comment