llListen控制音量示例
作者:梦翔儿 日期:2007-7-15 19:50:00
以下是控制音量的示例,将这个脚本和bell音乐放在一起,当在公共频道说low,medium,high是音量会不同.

float volumeLow=0.3;           // make a volumelowvariable
float volumeMedium=0.6;
float volumeHigh=1.0;

default
{
    state_entry()
    {
        llListen(0,"",NULL_KEY,""); //listen on channel 0 to anyone
    }

    listen(integer channel,string name,key id,string message) //this is the listen event
{
    if (message=="low")    //if someone says low
    {
        llPlaySound("bell",volumeLow);   
    }
   
    if (message=="medium")    //if someone says Medium
    {
        llPlaySound("bell",volumeMedium);   
    }   
   
    if (message=="high")    //if someone says Medium
    {
        llPlaySound("bell",volumeHigh);   
    }
}
}

  • 标签:llListen second life 
  • 发表评论:

      大名:
      密码: (游客无须输入密码)
      主页:
      标题:
    Powered by Oblog.