Advertisement
Sabia_Innovia

Dreidel Script 7

Dec 13th, 2020
687
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. 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.     // script initialization here
  36.     state_entry()
  37.     {
  38.         touch_start(integer total_number)
  39.         {
  40.             checkIsEffectOn();
  41.         }
  42.  
  43.        
  44.         //toggle isEffectOn between TRUE and FALSE
  45.         isEffectOn = !isEffectOn;
  46.     }
  47.    
  48.  
  49.      
  50.  
  51. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement