Guest User

Untitled

a guest
Nov 16th, 2018
103
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.89 KB | None | 0 0
  1. integer kunChan;
  2. integer upChan;
  3. integer start;
  4. integer askChan;
  5.  
  6. integer amount;
  7. integer amountMax;
  8.  
  9. default
  10. {
  11. state_entry()
  12. {
  13. llMessageLinked(LINK_ROOT, askChan, "kAmount", NULL_KEY);
  14. }
  15.  
  16. link_message(integer sender, integer channel, string message, key id)
  17. {
  18. if(channel == start)
  19. {
  20. list msgData = llParseString2List(message, [], []);
  21.  
  22. integer kAmount = llList2Integer(msgData, 0);
  23.  
  24. amount = kAmount;
  25. amountMax = kAmount;
  26. }
  27. if(channel == askChan)
  28. {
  29.  
  30. list msgData = llParseString2List(message, [":"], []);
  31.  
  32. string name = llList2String(msgData, 0);
  33. integer kAmount = llList2Integer(msgData, 1);
  34. llOwnerSay((string)kAmount);
  35.  
  36. if(name == "kunai")
  37. {
  38. llOwnerSay("3" + (string)kAmount);
  39. amount = kAmount;
  40. amountMax = kAmount;
  41. }
  42. }
  43. if(channel == upChan)
  44. {
  45. if(message == "plus")
  46. {
  47. llOwnerSay("increased");
  48. amountMax += 1;
  49. amount += 1;
  50. }
  51. }
  52. }
  53.  
  54. touch_start(integer total_number)
  55. {
  56. llRequestPermissions(llGetOwner(), PERMISSION_TRIGGER_ANIMATION);
  57. llStartAnimation("throw");
  58. llSleep(0.5);
  59. llWhisper(kunChan,(string)llGetOwner() + ":" + "kun2");
  60. llSleep(0.7);
  61.  
  62. amount -= 1;
  63. llOwnerSay((string)amount);
  64.  
  65. if(amount <= 0)
  66. {
  67. amount = 0;
  68. state recount;
  69. }
  70. }
  71. }
  72.  
  73. state recount
  74. {
  75. state_entry()
  76. {
  77. llOwnerSay("You have used up your supply of Kunai's, you must wait five minutes for them to refil");
  78. llSleep(10);
  79. llOwnerSay("Kunai's Refilled");
  80. state default;
  81. }
  82. }
Add Comment
Please, Sign In to add comment