I have an odd problem with llPlaySound() in a HUD I'm making. I have a HUD that will randomly choose a sound to play. For the most part it seems to work. But for some reason if I touch the button too quickly ... the next choosen sound file won't play. But it will play the same exact sound file correctly at other times. Definitely nothing wrong with the sound files themselves. Just not sure why sometimes the llPlaySound() doesn't engage. Am I not checking for something properly?
// Setup random number generator
integer random_integer( integer min, integer max )
{
return min + (integer)( llFrand( max - min + 1 ) );
}
default
{
state_entry()
{
}
touch_end(integer total_number)
{
// Find out how many sound files we have in the object and randomly select one
integer soundToUse = random_integer(0, llGetListLength(gSoundList)-1);
// Grab description for our selected sound file
llPlaySound(llList2String(gSoundList, soundToUse),1.0);
llSay(PUBLIC_CHANNEL, llList2String(gSoundTextList, soundToUse));
}
}
Skilar