Jump to content

Play Sound When User Types Something on A Channel


Proletarian Venus
 Share

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

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

Recommended Posts

I've made this script to play a sound from an objects inventory when a user types "one" on channel 23.

It should work, it shows up green "script is okay" symbol on the top right corner of the script text box, but it doesn't work, no matter what I do.

Help? Here is the script. It's not my sound as that works, and its not the sound files I';ve chosen as those all play fine independently.

 

Quote

default
{
    state_entry()
    {
        llListen(23,"", NULL_KEY, "");
    }
    listen(integer channel, string name, key id, string message)
    {
        if (message == "one") {
        llPlaySound(llGetInventoryName(INVENTORY_SOUND,0),1);
        }
    }
}

 

Link to comment
Share on other sites

If you haven't tried Ron's suggestion, do it.  That will tell you whether the script is listening at all.  Then,

1. Be sure that you are actually typing in channel 23  >>>  "/23 one"

2. Try using llTriggerSound instead of llPlaySound

Link to comment
Share on other sites

After you save/compile the script in the object, make sure that the "Running" checkbox is in fact checked. I have seen instances where it was turned off without my realizing it.

Also, how far away from the object is your camera? Because sometimes sounds in SL tend to have a steep falloff as your viewport gets further away from the source. As a test, zoom your camera right up to the object and listen if you can hear the sound. Combine that with the other diagnostic instrumentation suggested by the others.

 

Link to comment
Share on other sites

You are about to reply to a thread that has been inactive for 1723 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...