Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

Script needed fast...

Sierra Weames
Registered User
Join date: 16 Dec 2007
Posts: 116
09-04-2009 19:32
This is probably something simple i can't figure out. I'm trying to make my own ambient sound prim with multiple sounds in it. The only script i have is for a single sound and I don't know how to make it for multiple or to play them randomly. I need the script full perm. If you can do it shoot me a price you want for the script. The sooner the better. Thank you :)
Sindy Tsure
Will script for shoes
Join date: 18 Sep 2006
Posts: 4,103
09-04-2009 19:50
Untested but this might work...
CODE

float TIME = 30.0; // play a sound every 30 seconds
float VOLUME = 0.5; // 0.0 = off, 1.0 = full volume

integer gCount;

default
{
state_entry()
{
gCount = llGetInventoryNumber(INVENTORY_SOUND);
llSetTimerEvent (TIME);
}

changed (integer mask)
{
if (mask & CHANGED_INVENTORY)
{
gCount = llGetInventoryNumber(INVENTORY_SOUND);
}
}

timer()
{
string sound = llGetInventoryName(INVENTORY_SOUND, (integer)llFrand((gCount)));

llPlaySound(sound, VOLUME);
}
}
_____________________
Sick of sims locking up every time somebody TPs in? Vote for SVC-3895!!!
- Go here: https://jira.secondlife.com/browse/SVC-3895
- If you see "if you were logged in.." on the left, click it and log in
- Click the "Vote for it" link on the left