if else 语句的示例
作者:梦翔儿 日期:2007-7-23 16:44:00

default
{
    touch_start(integer total_number)
    {
        llSay(0, "What is your favorite band? Reply using chat.");
        state new;
    }
}

state new
{
    state_entry()
    {
    llListen(0,"",NULL_KEY,"");    //listen to anyone
    }
   
    listen(integer channel,string name,key id, string message)
    {
        if (message=="RUSH")
        {
            llSay(0,"Of course it's Rush.") ;  
            state default;
        }  
        else
        {
            llWhisper(0,"Wrong answer,click again and answer RUSH");
            state default;  // go back to the default
        }
    }
}

  • 标签:if else second life lsl 
  • 发表评论:

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