Jump to content

need help for a script


pheinox
 Share

You are about to reply to a thread that has been inactive for 3671 days.

Please take a moment to consider if this thread is worth bumping.

Recommended Posts

i need help. for the life of me i cant build a script that plays sound files in order from the inventory when the avatar walks.

just like a walker but can play multiple sound files to make 20 or idunno 50 second loops ive been trng for almost mounth to build it but i runn into all kinds of errors i dont know how to fix

 

so if any one knows of one or is able to make one that would be very helpful

Link to comment
Share on other sites

i dfo have a script that sort of dose what i need it to but ive been trying to make it so it dosnt play the first sound over after one use it woul play both files in order then play the first one agian and play both in  order agian

 

 

key owner;

key sound1="part 1";
key sound2="part 2";

integer tlapse =0;

default
{
changed(integer ch)
{
if(ch&CHANGED_OWNER)
{
llResetScript();
}
}


state_entry()
{
owner=llGetOwner();
llSetSoundQueueing(TRUE);
llSetTimerEvent(0.5);

}


timer()
{
if(llGetAgentInfo(owner) & AGENT_WALKING)
{
if ((llGetUnixTime() - tlapse) >= 1.0)
{
llPlaySound(sound1,1.0);
llPlaySound(sound2,1.0);
tlapse=llGetUnixTime();
}
}
else
{
llStopSound();
tlapse=0;
}
}
}

Link to comment
Share on other sites

  • 10 months later...

It's not really all that hard.  Treat it like a light switch problem.  Put a global switch in your script -- a variable that toggles TRUE/FALSE. Every time the timer event triggers, flip it from TRUE to FALSE or vice versa.  Then, depending on which one it is, play either sound #1 or sound #2.  The only minor trick is making sure that your timer doesn't fire any faster than the length of your longest sound clip, and being sure that the timer itself is turned off when AGENT_WALKING is FALSE.

Link to comment
Share on other sites

You are about to reply to a thread that has been inactive for 3671 days.

Please take a moment to consider if this thread is worth bumping.

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
 Share

×
×
  • Create New...