Jump to content

Play Sound When User Types Something on A Channel


You are about to reply to a thread that has been inactive for 536 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 post
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 post
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 post
Share on other sites
You are about to reply to a thread that has been inactive for 536 days.

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

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...