Advertisement
Gayngel

Untitled

Feb 19th, 2015
566
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.94 KB | None | 0 0
  1. integer PowerOn;
  2.  
  3. HideButton()
  4. {
  5.  
  6. llSetLinkPrimitiveParamsFast(3, [PRIM_COLOR,ALL_SIDES,<1.0,0.0,0.0>,0.0,PRIM_SIZE,<0.0,0.0,0.0>]);
  7.  
  8. llSetLinkPrimitiveParamsFast(4, [PRIM_COLOR,ALL_SIDES,<1.0,0.0,0.0>,0.0,PRIM_SIZE,<0.0,0.0,0.0>]);
  9.  
  10. }
  11.  
  12. ShowButton()
  13.  
  14. {
  15. llSetLinkPrimitiveParamsFast(3, [PRIM_COLOR,ALL_SIDES,<1.0,0.0,0.0>,1.0]);
  16.  
  17. llSetLinkPrimitiveParamsFast(4, [PRIM_COLOR,ALL_SIDES,<0.0,1.0,0.0>,1.0]);
  18.  
  19. llSleep(0.1);
  20.  
  21. llSetLinkPrimitiveParamsFast(3, [PRIM_SIZE,<0.48,0.48,0.0>]);
  22.  
  23. llSetLinkPrimitiveParamsFast(4, [PRIM_SIZE,<0.48,0.48,0.0>]);
  24.  
  25.  
  26.  
  27.  
  28.  
  29.  
  30. }
  31.  
  32.  
  33. default
  34. {
  35. state_entry()
  36. {
  37.  
  38. HideButton();
  39. }
  40.  
  41. touch_end(integer total_number)
  42. {
  43.  
  44. PowerOn = !PowerOn;
  45. integer touched = llDetectedLinkNumber(0);
  46.  
  47. llOwnerSay((string)touched);
  48.  
  49.  
  50. if (PowerOn && touched == 2|5|6)
  51. {
  52. llSetLinkPrimitiveParamsFast(5, [PRIM_COLOR,ALL_SIDES,<1.0,0.0,1.0>,1.0, PRIM_GLOW, ALL_SIDES, 0.05]);
  53.  
  54.  
  55. llSetLinkPrimitiveParamsFast(6, [PRIM_COLOR,ALL_SIDES,<1.0,0.0,1.0>,1.0, PRIM_GLOW, ALL_SIDES, 0.05]);
  56.  
  57. ShowButton();
  58. }
  59.  
  60. if (!PowerOn && touched == 2|5|6)
  61. {
  62. llSetLinkPrimitiveParamsFast(5, [PRIM_COLOR,ALL_SIDES,<1.0,1.0,1.0>,1.0, PRIM_GLOW, ALL_SIDES, 0.0]);
  63.  
  64.  
  65. llSetLinkPrimitiveParamsFast(6, [PRIM_COLOR,ALL_SIDES,<1.0,1.0,1.0>,1.0, PRIM_GLOW, ALL_SIDES, 0.0]);
  66. HideButton();
  67. }
  68.  
  69.  
  70. if (touched == 3)
  71. {
  72.  
  73. llOwnerSay("Red");
  74.  
  75.  
  76.  
  77. }
  78.  
  79.  
  80. if (touched == 4)
  81. {
  82.  
  83.  
  84. llOwnerSay("Green");
  85.  
  86.  
  87.  
  88. }
  89.  
  90. }
  91.  
  92.  
  93. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement