Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

Click item plays sounds script

Zachary Hutson
Registered User
Join date: 21 Jun 2006
Posts: 4
08-02-2006 04:14
I got an item and I want it to play multiple sounds, could someone help me with the basics with the script? Then I can generally figure it out.. I just need a base to work with..
Damanios Thetan
looking in
Join date: 6 Mar 2004
Posts: 992
08-02-2006 06:22
Multiple sounds in sequence, at random? Can you be a little more specific?


random:
CODE

list sounds = ["uuid1","uuid2","uuid3"];

default
{
state_entry
{
// make sure sounds play till end;
llSetSoundQueuing(TRUE);
}

touch_start(integer num)
{
// random sound
llPlaySound(llList2String(sounds,(integer) llFrand(llGetListLength(sounds)),1.0);

// sequence
integer t;
for(t=0;t<llGetListLength(sounds);t++) {
llPlaySound(llList2String(sounds, t), 1.0);
}
}
}


uuid1 etc. are the UUIDs of the sounds. (inventory, right click on sound, select 'copy uuid' and paste in script)

I haven't tested it in world, so could be buggy.
_____________________
Zachary Hutson
Registered User
Join date: 21 Jun 2006
Posts: 4
heh
08-02-2006 12:12
nah not really random just in numerical order
Angela Salome
Registered User
Join date: 6 Oct 2005
Posts: 224
08-02-2006 13:29
From: Zachary Hutson
I got an item and I want it to play multiple sounds, could someone help me with the basics with the script? Then I can generally figure it out.. I just need a base to work with..


Look in Yadni's junk yard for the scripts box. Inside one is "Psyke's Music Script". That forms a base for writing one. I've sent a copy to you in SL.