Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

help

Red Fox
Registered User
Join date: 22 Feb 2005
Posts: 1
07-06-2005 14:40
i need a juketrack script or something similar. plz post the script.
the script i need plays wav files in an object in order
Torn Bobbysocks
Registered User
Join date: 6 Jul 2005
Posts: 11
07-06-2005 14:46
Try this :)
CODE

integer SOUND_LENGTH = 10; // Each sound is 10 seconds long.
float VOLUME = 1.0;

integer curSound;
default { // Jukebox off
touch_start(integer totalNum) {
state playin;
}
}

state playin {
state_entry() {
curSound = 0;
llSetTimerEvent(0.1); // Trigger ASAP!
}

timer() {
integer numSounds = llGetInventoryNumber(INVENTORY_SOUND);
if (curSound < numSounds) {
llPlaySound(llGetInventoryName(INVENTORY_SOUND, curSound), VOLUME);
} else {
state default;
}
++curSound;
llSetTimerEvent(SOUND_LENGTH);
}

touch_start(integer totalNum) {
llStopSound();
state default;
}
}