Jump to content

If Else Channels ilIsten


AnaZofia
 Share

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

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

Recommended Posts

Hi Im trying to get a script to work 

Can anyone please help me? (im new to scripting)

Here is what i gotso far:

 

default
{
    state_entry()
    {
        llListen( 10, "", NULL_KEY, "" ); 
    }
    listen( integer channel, string name, key id, string message )
    {
        if ( message == "open sesame" )
        {
            llWhisper( 0, "Welcome, sesame!" );
           
        }
        
        {
        if ( message == "open" )
        {
            llWhisper( 0, "Welcome, open!" );
       
        }
        {
        if ( message == "open3" )
        {
            llWhisper( 0, "Welcome, open3!" );
           
        }
        
        
        
        
        else
        {
            llWhisper( 0, "That's not the magic word." );
          
        }
    }
}
}
}

 

Link to comment
Share on other sites

need to use else if

also far to many { in there

default{    state_entry()    {        llListen( 10, "", NULL_KEY, "" );     }    listen( integer channel, string name, key id, string message )    {        if ( message == "open sesame" )        {            llWhisper( 0, "Welcome, sesame!" );                   }        else if ( message == "open" )        {            llWhisper( 0, "Welcome, open!" );               }        else if ( message == "open3" )        {            llWhisper( 0, "Welcome, open3!" );                   }                                else        {            llWhisper( 0, "That's not the magic word." );                  }    }}

 

  • Like 1
Link to comment
Share on other sites

  • 2 weeks later...

if ( message == "open sesame" )        {            llWhisper( 0, "Welcome, sesame!" );                   }                { //this is incorrect and not needed        if ( message == "open" )        {            llWhisper( 0, "Welcome, open!" );               }        {// this to

simple logik, am i doing this or not. ie

if

{ im rich say wow

}

else if

{ im poor say oh well, im

healthy

}

else

{ im off for a cup of coffee, nothing of any use here.

}

you are asking a true or false question.

 

when the statement is false it will go to the next true or false line and so on.

 

also the else statement is more of conclusoin that nothig fits the true or false statements.

  • Like 1
Link to comment
Share on other sites

  • 2 weeks later...
You are about to reply to a thread that has been inactive for 4351 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...