// SPDX-License-Identifier: MIT // Copyright (c) 2026 Incoprea // Timed inventory playlist // Not compiled or tested in-world // Setup: Add sounds first, second and third; edit TRACKS as alternating sound name and seconds. Owner-touch starts or stops. // Stop / restore: Touch to stop and silence the current attached sound before removing. // 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. Duration is supplied by you; the script does not detect clip length. // License: see LICENSE in this distribution. // Original Incoprea. MIT. Not compiled or tested in-world. list TRACKS=["first",4.0,"second",5.0,"third",3.0]; integer index; integer active; next() { if(index>=llGetListLength(TRACKS)) { active=FALSE; llSetTimerEvent(0.0); return; } string name=llList2String(TRACKS,index); float seconds=llList2Float(TRACKS,index+1); index+=2; if(seconds<1.0)seconds=1.0; if(llGetInventoryType(name)==INVENTORY_SOUND)llPlaySound(name,0.3); else llOwnerSay("Missing sound: "+name); llSetTimerEvent(seconds); } default { touch_start(integer n) { if(llDetectedKey(0)!=llGetOwner())return; active=!active; if(active) { index=0; next(); } else { llSetTimerEvent(0.0); llStopSound(); } } timer() { next(); } }