Advertisement
Sabia_Innovia

Dreidel Script 6

Dec 13th, 2020
679
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. // This script is adapted from the Second Lif Wiki at:
  2. // http://wiki.secondlife.com/wiki/Category:LSL_Light
  3. // Instead of turning on light, it rotates the prim and provides provide floating text
  4. // Modified 12/8/20 by Sabia Innovia, Innovia Designs
  5.  
  6. integer isEffectOn;
  7.  
  8. integer checkIsEffectOn();
  9.     {
  10.             if
  11.            
  12.             {
  13.             llSetText("Click\n\nMe!",<0,255,255>,1.0);
  14.               // Turn off rotation by setting gain to zero if prim not clicked
  15.               llTargetOmega(<0,0,1>,PI,0.0);  
  16.             }
  17.             else
  18.             {
  19.                 llSetText("Happy\n\nHannukkah!",<0,255,255>,1.0);
  20.                 // turn on rotation - spin the dreidel!
  21.                 llTargetOmega(<0,0,1>,PI,1.0);
  22.                
  23.             }
  24.  
  25.     }
  26.  
  27. default
  28. {
  29.     // reset script when the object is rezzed
  30.     on_rez(integer start_param)
  31.     {
  32.         llResetScript();
  33.     }
  34.  
  35.     changed(integer change)
  36.     {
  37.         // reset script when the owner or the inventory changed
  38.         if (change & (CHANGED_OWNER | CHANGED_INVENTORY)) llResetScript();
  39.     }
  40.  
  41.     // script initialization here
  42.     state_entry()
  43.     {
  44.         touch_start(integer total_number)
  45.         //toggle isEffectOn between TRUE and FALSE
  46.         isEffectOn = !isEffectOn;
  47.     }
  48.    
  49.     checkIsEffectOn()
  50.     {
  51.          if (!isEffectOn)()  
  52.     }
  53.      
  54.  
  55. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement