Advertisement
salahzar

Lampada si accende sul canale 100 (canale 200 per colore)

Apr 27th, 2013
176
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. accendi()
  2. {
  3.     llSetPrimitiveParams([PRIM_FULLBRIGHT,ALL_SIDES,TRUE,
  4.                         PRIM_POINT_LIGHT,TRUE,
  5.                                     <1.0,0.7,1.0>,  // light color vector range: 0.0-1.0 *3
  6.                                     1.0,            // intensity    (0.0-1.0)
  7.                                     10.0,           // radius       (.1-20.0)
  8.                                     0.6
  9. ]);
  10. }
  11.  
  12. spegni()
  13. {
  14.      llSetPrimitiveParams([PRIM_FULLBRIGHT,ALL_SIDES,FALSE,
  15.      PRIM_POINT_LIGHT, FALSE,   // if this is false, light is off,
  16.                                      <0.0,1.0,0.0>,1.0, 10.0, 0.5
  17.      
  18.      ]);
  19. }
  20.  
  21.  
  22. default
  23. {
  24.     state_entry()
  25.     {
  26.         spegni();
  27.         llSetText("Listen on 100",<1,1,1>,1);
  28.         llListen(100,"",NULL_KEY,"");
  29.         llListen(200,"",NULL_KEY,"");
  30.     }
  31.     listen(integer channel,string name,key id,string str)
  32.     {
  33.         if(channel==100)
  34.         {
  35.             if(str=="ON")
  36.                 accendi();
  37.             else
  38.                 spegni();
  39.         }
  40.         if(channel==200)
  41.         {
  42.             llSetColor(str,ALL_SIDES);
  43.         }
  44.     }
  45.  
  46. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement