Search the Community
Showing results for tags 'each'.
-
Hello! I want to create a script that allows you to play different sounds with each animation (e.g. running, walking, swimming...) based on the simple walker script. How it should look like? Is it possible to assign a separate sound for each animation with such script? Perhaps you will advise to be based on another script? Thank you. Here is the script on which I'm based: string walk_sound = "34eae688-8b2d-d86c-5c1e-4e3eb865ca0d"; string stop_sound = "81603357-2b3c-bc7a-5d15-eb20fcca22a1"; string run_sound = "b1c0f5e2-45e5-e0b2-926a-fd60520ed4ee"; float volume = 1.0; integer i = TRUE; key owner; default { state_entry() { llSetTimerEvent(.3); } timer() { string anim = llGetAnimation(llGetOwner()); if ((anim == "Walking") || (anim == "CrouchWalking")) { llLoopSound(walk_sound,volume); i=FALSE; } else if ((anim == "Running")) { llLoopSound(run_sound,volume); i=FALSE; } else { llStopSound(); if (i == FALSE) { llTriggerSound(stop_sound,volume); } i=TRUE; } } }