Advertisement
Guest User

Untitled

a guest
Jun 25th, 2019
71
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.29 KB | None | 0 0
  1. key User;
  2. integer Channel;
  3. default
  4. {
  5. on_rez(integer startParam)
  6. {
  7. Channel = startParam;
  8. llListen(Channel, "", "", "");
  9. llSetTimerEvent(60);
  10. llSetPrimitiveParams([PRIM_TEMP_ON_REZ, TRUE]);
  11. }
  12. timer()
  13. {
  14. llDie();
  15. }
  16. listen(integer channel, string name, key id, string message)
  17. {
  18. list Data = llCSV2List(message);
  19. string Command = llList2String(Data,0);
  20. string Command2 = llList2String(Data,1);
  21. string Command3 = llList2String(Data,2);
  22.  
  23. if(Command == "Setup")
  24. {
  25. User = (key)Command2;
  26. llRequestPermissions(User,PERMISSION_ATTACH);
  27. }
  28. if(Command == "Remove")
  29. {
  30. if(llGetOwnerKey(id) == User || Command2 == User)
  31. {
  32. state Remove;
  33. }
  34. }
  35. if(message == "S:Remove")
  36. {
  37. {
  38. llStopAnimation("Drink Coffee_Male");
  39. state Remove2;
  40. }
  41. }
  42. }
  43. run_time_permissions( integer Perms )
  44. {
  45. if(Perms & PERMISSION_ATTACH )
  46. {
  47. llAttachToAvatarTemp(0);
  48. llStartAnimation("Drink Coffee_Male");
  49. }
  50. else
  51. {
  52. llDie();
  53. }
  54. }
  55. attach(key id)
  56. {
  57. if(id != NULL_KEY)
  58. {
  59. llSetTimerEvent(0);
  60. llSay(Channel,"Remove");
  61. }
  62. }
  63. touch_start(integer num_detected)
  64. {
  65. if(llDetectedKey(0) == User)
  66. {
  67. llStopAnimation("Drink Coffee_Male");
  68. state Remove;
  69. }
  70. }
  71. }
  72. state Remove
  73. {
  74. state_entry()
  75. {
  76. llRequestPermissions(llGetOwner(),PERMISSION_ATTACH);
  77. }
  78. run_time_permissions( integer Perms )
  79. {
  80. if(Perms & PERMISSION_ATTACH )
  81. {
  82. llStopAnimation("Drink Coffee_Male");
  83. llDetachFromAvatar();
  84. }
  85. }
  86. }
  87. state Remove2
  88. {
  89. state_entry()
  90. {
  91. llRequestPermissions(llGetOwner(),PERMISSION_ATTACH);
  92. }
  93. run_time_permissions( integer Perms )
  94. {
  95. if(Perms & PERMISSION_ATTACH )
  96. {
  97. llStopAnimation("Drink Coffee_Male");
  98. llDetachFromAvatar();
  99. }
  100. }
  101. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement