Advertisement
Dorex

Untitled

Feb 20th, 2024
59
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.63 KB | None | 0 0
  1. //goes in hair 2
  2.  
  3. integer ActiveHair;
  4.  
  5. integer HAIRTYPE_HAIR = 1;
  6. integer HAIRTYPE_PONYTAIL = 2;
  7. integer HAIRTYPE_UNKNOWN = 3;
  8.  
  9. showHair()
  10. {
  11. float i;
  12. for (i = 0; i<1.1; i += 0.1){
  13. llSetLinkAlpha(LINK_SET, i, ALL_SIDES);
  14. llSleep(0.02222);
  15. }
  16. }
  17.  
  18. hideHair()
  19. {
  20. float i;
  21. for (i = 1; i>0; i-= 0.1){
  22. llSetLinkAlpha(LINK_SET, i, ALL_SIDES);
  23. llSleep(0.02222);
  24. }
  25. }
  26.  
  27. default
  28. {
  29. state_entry()
  30. {
  31. ActiveHair = HAIRTYPE_HAIR;
  32. llListen(0, "", llGetOwner(), "");
  33. }
  34.  
  35. listen(integer Channel, string Name, key ID, string Text)
  36. {
  37. if (~llSubStringIndex(Text, "hair")){
  38. if (~llListFindList(llParseString2List(Text, [" ", ",", ".", "-", "!", "?", ":"], []), ["hair"]))
  39. {
  40. if (ActiveHair == HAIRTYPE_PONYTAIL){
  41. ActiveHair = HAIRTYPE_HAIR;
  42. hideHair();
  43.  
  44. }else if(ActiveHair == HAIRTYPE_HAIR){
  45. ActiveHair = HAIRTYPE_PONYTAIL;
  46. showHair();
  47. }
  48. }
  49. }else if (~llSubStringIndex(Text, "ponytail")){
  50. if (~llListFindList(llParseString2List(Text, [" ", ",", ".", "-", "!", "?", ":"], []), ["ponytail"]))
  51. {
  52. if (ActiveHair != HAIRTYPE_UNKNOWN){
  53. ActiveHair = HAIRTYPE_UNKNOWN;
  54. hideHair();
  55.  
  56. }else if(ActiveHair == HAIRTYPE_UNKNOWN){
  57. ActiveHair = HAIRTYPE_HAIR;
  58. llSetLinkAlpha(LINK_SET, 0, ALL_SIDES);
  59. }
  60. }
  61. }
  62. }
  63. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement