Sabia_Innovia

Dreidel Script 3

Dec 13th, 2020
239
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. default
  9. {
  10.     on_rez(integer start_param)
  11.     {
  12.         // Restarts the script every time the object is rezzed
  13.         llResetScript();
  14.     }
  15.    
  16.     touch_start(integer total_number)
  17.     {
  18. //      toggle isEffectOn between TRUE and FALSE
  19.         isEffectOn = !isEffectOn;
  20.  
  21.         if (!isEffectOn)
  22.         {
  23.         llSetText("Click\n\nMe!",<0,255,255>,1.0);
  24.           // Turn off rotation by setting gain to zero if prim not clicked
  25.           llTargetOmega(<0,0,1>,PI,0.0);  
  26.         }
  27.         else
  28.         {
  29.             llSetText("Happy\n\nHannukkah!",<0,255,255>,1.0);
  30.             // turn on rotation - spin the dreidel!
  31.             llTargetOmega(<0,0,1>,PI,1.0);
  32.            
  33.         }
  34.     }
  35. }
Add Comment
Please, Sign In to add comment