Advertisement
Shinobiace

Menu(QuizForFish)

Sep 28th, 2020
353
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. string question;
  2. string correctanswer;
  3. string answer2;
  4. string answer3;
  5. string answer4;
  6.  
  7. list buttons;
  8.  
  9. key touchid;
  10. integer mchan;
  11. integer IntValue;
  12. default
  13. {
  14.     state_entry()
  15.     {
  16.         mchan = -1 - (integer)("0x" + llGetSubString( (string)llGetKey(), -8, -1) );
  17.         question = "\n" + "What Fish did you caught?";
  18.         llListen(-11223,"","","");
  19.         answer2 = "";
  20.         answer3 = "";
  21.         answer4 = "";
  22.         buttons = [answer2,answer3,answer4];
  23.     }
  24.  
  25.    
  26.     listen(integer channel, string name, key id, string msg)
  27.     {
  28.         //Listen for correct answer
  29.        
  30.         if(channel == -11223)
  31.         {
  32.             IntValue = (integer)msg;
  33.             correctanswer = (string)IntValue;
  34.             answer2 = correctanswer;
  35.             if(answer2 = "1")
  36.             {
  37.                 answer2= "Small Fish";
  38.                 answer3= "Medium Fish";
  39.                 answer4= "Big Fish";
  40.                 return;
  41.             }
  42.             else if(answer2 = "2")
  43.             {
  44.                 answer2= "Medium Fish";
  45.                 answer3= "Small Fish";
  46.                 answer4= "Big Fish";
  47.                 return;
  48.             }
  49.             else if(answer2 = "3")
  50.             {
  51.                 answer2= "Big Fish";
  52.                 answer3= "Medium Fish";
  53.                 answer4= "Small Fish";
  54.                 return;
  55.             }
  56.                                    
  57.         }
  58.         if(msg=="Small Fish")
  59.         {
  60.             llSay(0,"you've selected Small Fish");
  61.         }
  62.         else if(msg = "Medium Fish")
  63.         {
  64.             llSay(0,"you've selected Medium Fish");
  65.         }
  66.         else if(msg = "Big Fish")
  67.         {
  68.             llSay(0,"you've selected Big Fish");
  69.         }
  70.              
  71.     }
  72.      touch_start(integer num_detected)
  73.     {
  74.         touchid = llDetectedKey(0);
  75.         llDialog(touchid, question, buttons, mchan);
  76.        
  77.  
  78.     }
  79. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement