integer SoundFileNum = 0; float TimerInterval = 10.0; integer SoundState = 1; PlayNextSound() { string SoundFile; if (SoundFileNum >= llGetInventoryNumber(INVENTORY_SOUND)) SoundFileNum = 0; SoundFile = llGetInventoryName(INVENTORY_SOUND, SoundFileNum++); if (SoundFile != "") { llOwnerSay("Playing " + SoundFile); llLoopSound(SoundFile, 1.0); } } default { state_entry() { PlayNextSound(); llSetTimerEvent(TimerInterval); } touch_start(integer num) { if (llDetectedKey(0) == llGetOwner()) { SoundState = !SoundState; llOwnerSay("Sounds " + llList2String(["Off", "On"], SoundState)); if (SoundState) { PlayNextSound(); llSetTimerEvent(TimerInterval); } else { llStopSound(); llSetTimerEvent(0.0); } } } changed(integer change) { if (change & (CHANGED_REGION_START | CHANGED_REGION)) llResetScript(); } timer() { PlayNextSound(); } }