Advertisement
Guest User

Untitled

a guest
Feb 16th, 2019
278
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. // AutoLight
  2. // Written by Pantera Polnocy
  3.  
  4. // --- Config start
  5.  
  6. float LightRadiusInMetres = 10.0;
  7. float LightIntensity = 1.0;
  8. float LightFalloff = 1.0;
  9. float GlowLevel = 0.75;
  10.  
  11. // --- Config end
  12.  
  13. integer dayTime = 3;
  14. default {
  15.     on_rez(integer p) {
  16.         llResetScript();
  17.     }
  18.     state_entry() {
  19.         llSetLinkPrimitiveParamsFast(LINK_THIS,[PRIM_GLOW,ALL_SIDES,0,PRIM_FULLBRIGHT,ALL_SIDES,FALSE]);
  20.         llSetTimerEvent(300);
  21.         llSetMemoryLimit(llGetUsedMemory() + 2048);
  22.     }
  23.     timer() {
  24.         vector s = llGetSunDirection();
  25.         if(s.z < 0.0) {
  26.             if(dayTime != 2) {
  27.                 dayTime = 2;
  28.                 llSetLinkPrimitiveParamsFast(LINK_THIS,[PRIM_COLOR,ALL_SIDES,<1,0.5,0>,1.0,PRIM_FULLBRIGHT,ALL_SIDES,TRUE,PRIM_GLOW,ALL_SIDES,GlowLevel,PRIM_POINT_LIGHT,TRUE,<1,0.5,0>,LightIntensity,LightRadiusInMetres,LightFalloff]);
  29.             }
  30.         }
  31.         else if(s.z > 0.0) {
  32.             if(dayTime != 1) {
  33.                 dayTime = 1;
  34.                 llSetLinkPrimitiveParamsFast(LINK_THIS,[PRIM_COLOR,ALL_SIDES,<1,0.5,0>,1.0,PRIM_FULLBRIGHT,ALL_SIDES,FALSE,PRIM_GLOW,ALL_SIDES,0,PRIM_POINT_LIGHT,FALSE,<1,0.5,0>,0,0,0]);
  35.             }
  36.         }
  37.     }
  38. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement