Advertisement
giratina1999

Untitled

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