// SPDX-License-Identifier: MIT // Copyright (c) 2026 Incoprea // Shuffled sound collection // Not compiled or tested in-world // Setup: Use clips shorter than GAP seconds in a dedicated sound prim. Owner-touch starts or cancels. // Stop / restore: Touch during the sequence to stop. After the final clip, Stop sound in this prim can silence it immediately. // Notes: Use licensed sounds in the exact prim containing the script. Playback is audible nearby. Asset loading and simulator timers can introduce delays; these are exhibit cues, not sample-accurate audio. The sound names are shuffled once when starting; inventory changes mid-run are safely skipped. // License: see LICENSE in this distribution. // Original Incoprea. MIT. Not compiled or tested in-world. float GAP=12.0; list bag; integer active; next() { if(!llGetListLength(bag)) { active=FALSE; llSetTimerEvent(0.0); return; } string name=llList2String(bag,0); bag=llDeleteSubList(bag,0,0); if(llGetInventoryType(name)==INVENTORY_SOUND)llPlaySound(name,0.25); llSetTimerEvent(GAP); } default { touch_start(integer n) { if(llDetectedKey(0)!=llGetOwner())return; active=!active; if(!active) { llSetTimerEvent(0.0); llStopSound(); return; } if(GAP<1.0)GAP=1.0; bag=[]; integer i; for(i=0;i