Advertisement
Pinksamurai

Dialog - Color Changing

Apr 4th, 2023
1,674
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. string Msg1;
  2. string Msg2;
  3. list Colors1;
  4. list Colors2;
  5. vector red = <1,0, 0>;
  6. vector blue = <0,0,1>;
  7. vector green = <0,1,0>;
  8. vector white = <1, 1, 1>;
  9. vector black = <0, 0, 0>;
  10. integer gChannelDialog;
  11. key User;
  12.  
  13.  
  14.  
  15. default
  16. {
  17.     state_entry()
  18.     {
  19.         gChannelDialog = -1305;
  20.        
  21.         llSetColor(white, ALL_SIDES);
  22.        
  23.         // set the list of buttons for each page.
  24.         Colors1 = ["Red", "Blue", "Green", "Next"];
  25.         Colors2 = ["black", "white", "Back"];
  26.        
  27.         User = llDetectedKey(0);
  28.         Msg1 = "\n Select a Color";
  29.         Msg2 ="\n Select Black or White";
  30.     }
  31.  
  32.     touch_start (integer total_number)
  33.     {
  34.         llDialog (User, Msg1, Colors1, gChannelDialog);
  35.         llListen(gChannelDialog,"", User, "");
  36.     }
  37.  listen (integer channel, string name, key id, string message)
  38.  {
  39.     if (message == "Next")
  40.     {
  41.       llDialog(User, Msg2, Colors2, gChannelDialog);
  42.     }
  43.    
  44.     else if (message == "Red")
  45.     {
  46.         llSetColor(red, ALL_SIDES);
  47.     }
  48.     else if (message == "Blue")
  49.     {
  50.         llSetColor(blue, ALL_SIDES);
  51.     }
  52.     else if (message == "Green")
  53.     {
  54.         llSetColor(green, ALL_SIDES);
  55.     }
  56.      else if (message == "White")
  57.     {
  58.         llSetColor(white, ALL_SIDES);
  59.     }
  60.      else if (message == "Black")
  61.     {
  62.         llSetColor(black, ALL_SIDES);
  63.     }
  64.      else if (message == "Back")
  65.     {
  66.         llDialog (User, Msg1, Colors1, gChannelDialog);
  67.     }  
  68. }
  69. }
Tags: Color dialog
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement