Advertisement
Guest User

Untitled

a guest
Aug 27th, 2019
146
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. // simple sun-tracking script by Ghosty Kips.
  2.  
  3. integer switch = TRUE;
  4. vector sun;
  5.  
  6. default
  7. {
  8.     state_entry()
  9.     {
  10.         llSetColor(<1,1,1>, ALL_SIDES);
  11.         llSetTimerEvent(1);
  12.     }
  13.    
  14.     timer()
  15.     {
  16.         sun=llGetSunDirection();
  17.         llSetText("Sun Position - Day: " + (string) sun.z, <0,0,0>, 1.0);
  18.  
  19.         if (sun.z < 0.00)
  20.         {
  21.             state night;
  22.         }
  23.     }
  24. }
  25.  
  26. state night
  27. {
  28.     state_entry()
  29.     {
  30.         llSetColor(<0,0,0>, ALL_SIDES);
  31.         llSetTimerEvent(1);
  32.     }
  33.        
  34.     timer()
  35.     {
  36.         sun=llGetSunDirection();
  37.         llSetText("Sun Position - Night: " + (string) sun.z, <1,1,1>, 1.0);
  38.        
  39.         if (sun.z >= 0.00)
  40.         {
  41.             llResetScript();
  42.         }
  43.     }
  44.  
  45. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement