Advertisement
xNawi

Running

Apr 28th, 2015
247
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.49 KB | None | 0 0
  1. #+--------------------------------------------------------------------------+#
  2. #| |#
  3. #| ____ _ _ ___ _ ___ _ _ ___ _ _____ |#
  4. #| | __ \ | | | | | |\ \ | | | |\ \ | | | | | |\ \ | | / ____| |#
  5. #| | |__) | | | | | | | \ \| | | | \ \| | | | | | \ \| | | | __ |#
  6. #| | _ / | | | | | | \ \ | | | \ \ | | | | | \ \ | | | |_ | |#
  7. #| | | \ \ | |___| | | | \ | | | \ | | | | | \ | | |__| | |#
  8. #| |_| \_\ |_______| |_| \_| |_| \_| |_| |_| \_| \______| |#
  9. #| |#
  10. #| An idea taken from the server mineplex.com |#
  11. #+--------------------------------------------------------------------------+#
  12.  
  13.  
  14.  
  15. options:
  16. tag: &8[&6RN&8]
  17. refresh: 1
  18. length: 5
  19. command /running [<text="null">] [<text>]:
  20. trigger:
  21. if player has permission "running.sk":
  22. if arg 1 is "null":
  23. send "{@tag} &6Available options:"
  24. send "&8> &6/running add <name>"
  25. send "&8> &6/running delete <name>"
  26. send "&8> &6/running give <name> &8- &7Adds sponge"
  27. send "&8> &6/running setblock <name> &8- &7Set block"
  28. send "&8> &6/running start"
  29. send "&8> &6/running stop"
  30. if arg 1 is "give":
  31. if arg 2 is set:
  32. if {running::list::*} contains arg 2:
  33. add 1 sponge named "&6%arg 2%" with lore "&6Running created" to player's inventory
  34. else:
  35. send "{@tag} &7Arena named &6%arg 2% &7don't exist."
  36. else:
  37. send "{@tag} &6/running give <name>"
  38. if arg 1 is "add":
  39. if arg 2 is set:
  40. if {running::list::*} contains arg 2:
  41. send "{@tag} &7Arena named &6%arg 2% &7don't exist."
  42. else:
  43. add 1 sponge named "&6%arg 2%" with lore "&6Running created" to player's inventory
  44. else:
  45. send "{@tag} &6/running add <name>"
  46. if arg 1 is "delete":
  47. if arg 2 is set:
  48. if {running::list::*} contains arg 2:
  49. loop {running::location::%arg 2%::*}:
  50. set block at loop-value to air
  51. remove arg 2 from {running::list::*}
  52. clear {running::location::%arg 2%::*}
  53. send "{@tag} &7Deleted arena &6%arg 2%&7."
  54. else:
  55. send "{@tag} &7Arena named &6%arg 2% &7don't exist."
  56. else:
  57. send "{@tag} &6/running delete <name>"
  58. if arg 1 is "setblock":
  59. if arg 2 is set:
  60. if {running::list::*} contains arg 2:
  61. set {running::block::%arg 2%} to player's tool
  62. send "{@tag} &7Block set &6%player's tool% &7for arena &6%arg 2%&7."
  63. else:
  64. send "{@tag} &7Arena named &6%arg 2% &7don't exist."
  65. else:
  66. send "{@tag} &6/running setblock <name>"
  67. if arg 1 is "start":
  68. set {running::start} to true
  69. send "{@tag} &7Successfully enabled."
  70. if arg 1 is "stop":
  71. set {running::start} to false
  72. send "{@tag} &7Successfully disabled."
  73. else:
  74. send "&cNo permission."
  75. every {@refresh} seconds:
  76. if {running::start} is true:
  77. loop {running::list::*}:
  78. set {_list%loop-index%} to loop-value
  79. broadcast "%{_list1}%"
  80. loop (size of {running::list::*}) times:
  81. if {_numer%{_list%loop-number-1%}%} is not set:
  82. set {_numer%{_list%loop-number-1%}%} to 1
  83. if {_numer%{_list%loop-number-1%}%} = {running::listBlock::%{_list%loop-number-1%}%}:
  84. set {_numer%{_list%loop-number-1%}%} to 1
  85. broadcast "4"
  86. set {_numer%{_list%loop-number-1%}%} to {_numer%{_list%loop-number-1%}%} + 1
  87. broadcast "5"
  88. loop {@length} times:
  89. set {_n} to {_numer%{_list%loop-number-1%}%} + loop-number-2
  90. loop {running::location::%{_list%loop-number-1%}%::*}:
  91. set {_index%loop-index%} to loop-value
  92. broadcast "6"
  93. if block at {_index%{_n}%} is not {running::block::%{_list%loop-number-1%}%}:
  94. set block at {_index%{_n}%} to {running::block::%{_list%loop-number-1%}%}
  95. broadcast "7"
  96. set block at {_index%{_numer%{_list%loop-number-1%}%}%} to mushroom
  97. broadcast "8"
  98. on place of sponge:
  99. add location of event-block to {running::location::test::*}
  100. add 1 to {running::listBlock::test}
  101. send "{@tag} &7Added &6%{running::listBlock::test}% &7block."
  102. on break of sponge:
  103. set {_x} to uncolored name of player's tool
  104. if {running::list::*} contains {_x}:
  105. if {running::location::%{_x}%::*} contains location of event-block:
  106. remove location of event-block from {running::location::%{_x}%::*}
  107. remove 1 from {running::listBlock::%{_x}%}
  108. send "{@tag} &7Removed &6%{running::listBlock::%{_x}%}% &7block."
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement