Advertisement
Sabia_Innovia

Dreidel Script 5

Dec 13th, 2020
618
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.     // reset script when the object is rezzed
  11.     on_rez(integer start_param)
  12.     {
  13.         llResetScript();
  14.     }
  15.  
  16.     changed(integer change)
  17.     {
  18.         // reset script when the owner or the inventory changed
  19.         if (change & (CHANGED_OWNER | CHANGED_INVENTORY)) llResetScript();
  20.     }
  21.  
  22.     // script initialization here
  23.     state_entry()
  24.     {
  25.         touch_start(integer total_number)
  26.         {
  27.             //toggle isEffectOn between TRUE and FALSE
  28.             isEffectOn = !isEffectOn;
  29.      
  30.             if (!isEffectOn)
  31.             {
  32.             llSetText("Click\n\nMe!",<0,255,255>,1.0);
  33.               // Turn off rotation by setting gain to zero if prim not clicked
  34.               llTargetOmega(<0,0,1>,PI,0.0);  
  35.             }
  36.             else
  37.             {
  38.                 llSetText("Happy\n\nHannukkah!",<0,255,255>,1.0);
  39.                 // turn on rotation - spin the dreidel!
  40.                 llTargetOmega(<0,0,1>,PI,1.0);
  41.                
  42.             }
  43.         }
  44.     }
  45. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement