Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

Touch Script to Cycle thru Sounds

Montez King
Definately Insane
Join date: 24 Oct 2004
Posts: 32
03-07-2005 09:07
I'm looking for a script that will cycle thru sounds on an object when you click the object.

Thank you
Cross Lament
Loose-brained Vixen
Join date: 20 Mar 2004
Posts: 1,115
03-07-2005 14:45
What, like this? (replace llPlaySound() with llLoopSound() if you want it to play the sounds continuously)

CODE
// Cross Lament's stupid touch-cycle sound script

integer step = -1 ;

default
{
state_entry()
{
llStopSound() ;
}

touch_start( integer num )
{
step++ ;

if( step >= llGetInventoryNumber( INVENTORY_SOUND ) ) step = 0 ;

llPlaySound( llGetInventoryName( INVENTORY_SOUND, step ), 1.0 ) ;
}
}
_____________________
- Making everyone's day just a little more surreal -

Teeple Linden: "OK, where did the tentacled thing go while I was playing with my face?"
Montez King
Definately Insane
Join date: 24 Oct 2004
Posts: 32
03-10-2005 10:23
Thanks! I'll try this as soon as I get home and let you know how it works
Montez King
Definately Insane
Join date: 24 Oct 2004
Posts: 32
03-13-2005 09:58
perfect!!! tyvm