X-Git-Url: https://feistymeow.org/gitweb/?a=blobdiff_plain;f=huffware%2Fhuffotronic_tools_n_testers_v6.1%2Fhamster_sound_effects_v0.8.txt;fp=huffware%2Fhuffotronic_tools_n_testers_v6.1%2Fhamster_sound_effects_v0.8.txt;h=163bc3822910e5a77cc04d5e57312804629f6d9b;hb=620a99face4f2cefadeed9ce69b4fd4f8d6e2b56;hp=0000000000000000000000000000000000000000;hpb=1fe10db9e00c16e771be0e3c4b8835b0c39553cb;p=feisty_meow.git diff --git a/huffware/huffotronic_tools_n_testers_v6.1/hamster_sound_effects_v0.8.txt b/huffware/huffotronic_tools_n_testers_v6.1/hamster_sound_effects_v0.8.txt new file mode 100755 index 00000000..163bc382 --- /dev/null +++ b/huffware/huffotronic_tools_n_testers_v6.1/hamster_sound_effects_v0.8.txt @@ -0,0 +1,38 @@ + +// huffware script: hamster sound effects, by fred huffhines +// +// a randomizing sound player, originally used to replace a sound +// playing script with bad perms in a freebie hamster. +// +// this script is licensed by the GPL v3 which is documented at: http://www.gnu.org/licenses/gpl.html +// do not use it in objects without fully realizing you are implicitly accepting that license. +// + +list all_sounds; + +default +{ + state_entry() { if (llSubStringIndex(llGetObjectName(), "huffotronic") < 0) state real_default; } + on_rez(integer parm) { state rerun; } +} +state rerun { state_entry() { state default; } } + +state real_default { + state_entry() { + llStopSound(); + integer indy; + for (indy = 0; indy < llGetInventoryNumber(INVENTORY_SOUND); indy++) { + all_sounds += [ llGetInventoryName(INVENTORY_SOUND, indy) ]; + } + } + + touch_start(integer cnt) { + all_sounds = llListRandomize(all_sounds, 1); + llTriggerSound(llList2String(all_sounds, 0), 1.0); + } + + changed(integer change) { + if (change & CHANGED_INVENTORY) llResetScript(); // reset when sounds might have changed. + } +} +