Advertisement
giratina1999

Untitled

Jan 31st, 2015
220
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. //i have this materialization script and i need help making so it does the opposite to make a de materialization effect
  2.  
  3. float time = 0.01;
  4.  
  5. default
  6. {
  7.     state_entry()
  8.     {
  9.         llSetLinkPrimitiveParams(LINK_SET,[PRIM_GLOW,ALL_SIDES,1.0]);
  10.         llSetLinkAlpha(LINK_SET,0.0,ALL_SIDES);
  11.         llSetTimerEvent(time);
  12.  
  13.     }
  14.  
  15.     on_rez(integer parameters)
  16.     {
  17.         llPlaySound("SmithLand",1);//to play the sound when object is rezzed
  18.  
  19.  
  20.         llSetLinkPrimitiveParams(LINK_SET,[PRIM_GLOW,ALL_SIDES,1.0]);
  21.         llSetLinkAlpha(LINK_SET,0.0,ALL_SIDES);
  22.         llSetTimerEvent(time);
  23.  
  24.     }
  25.  
  26.  
  27.     timer()
  28.     {
  29.  
  30.         float alpha=llGetAlpha(0);
  31.  
  32.         list params = llGetPrimitiveParams([PRIM_GLOW,0]);
  33.         float glow = llList2Float(params, 0);
  34.         //This next line you can uncomment to use for testing purposes to view the alpha and glow values during each step.
  35.         //llOwnerSay("Glow = " + (string)glow + "Alpha = " + (string)alpha);
  36.         llSetLinkPrimitiveParams(LINK_SET,[PRIM_GLOW,ALL_SIDES,glow-0.045]);
  37.         llSetLinkAlpha(LINK_SET,alpha + 0.05,ALL_SIDES);
  38.         if (alpha >= 1.0)
  39.         {
  40.            llSetTimerEvent(0.0);
  41.            llSetLinkPrimitiveParams(LINK_SET,[PRIM_GLOW,ALL_SIDES,0.0]);
  42.            llSetLinkAlpha(LINK_SET,1.0,ALL_SIDES);
  43.         }  
  44.     }
  45.  
  46.  
  47. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement