Advertisement
nunonuno_riku

Untitled

Oct 26th, 2018
118
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 8.80 KB | None | 0 0
  1. command /botsetup [<text>] [<text>]:
  2. trigger:
  3. if player has permission "bot.setup":
  4. if arg 1 is "setspawn":
  5. if arg 2 is "player":
  6. set {botarena.spawn.player} to location of player
  7. message "&7The &cplayer &7spawn of the bot arena has been set to &8:&c %{botarena.spawn.player}%" to player
  8. else if arg 2 is "bot":
  9. set {botarena.spawn.bot} to location of player
  10. message "&7The &cbot &7spawn of the bot arena has been set to &8:&c %{botarena.spawn.bot}%" to player
  11. else if arg 2 is "main":
  12. set {botarena.spawn.main} to location of player
  13. message "&7The &cmain &7spawn of the bot arena has been set to &8:&c %{botarena.spawn.main}%" to player
  14.  
  15. else:
  16. message "&8==========[&c&lPVP Bot&8]==========" to player
  17. message "&7>&c/botsetup setspawn <bot/player/main>" to player
  18. message "&7>&c/botsetup setsign" to player
  19. message "&7>&c/botsetup difficulty <easy/normal/hard>" to player
  20. message "&8==========[&c&lPVP Bot&8]==========" to player
  21. else if arg 1 is "setsign":
  22. if arg 2 is not set:
  23. if player's targeted block is sign:
  24. set line 1 of player's targeted block to "&8=========="
  25. set line 2 of player's targeted block to "&8[&c&lPVP Bot&8]"
  26. set line 3 of player's targeted block to "&f - &c&lJoin &f-"
  27. set line 4 of player's targeted block to "&8=========="
  28. else:
  29. message "&7This block is not a sign" to player
  30. else:
  31. message "&7Wrong usage!" to player
  32. else if arg 1 is "difficulty":
  33. if arg 2 is "easy":
  34. message "&7The bot arena &cdifficulty &7has been set to&8: &cEasy" to player
  35. set {botarena.difficulty} to "Easy"
  36. else if arg 2 is "normal":
  37. message "&7The bot arena &cdifficulty &7has been set to&8: &cNormal" to player
  38. set {botarena.difficulty} to "normal"
  39. else if arg 2 is "hard":
  40. message "&7The bot arena &cdifficulty &7has been set to&8: &cHard" to player
  41. set {botarena.difficulty} to "hard"
  42. else:
  43. message "&7Invaild entry" to player
  44. else if arg 1 is "reload":
  45. broadcast "&c&l%player%&7 is reloading the &c&lPVPBot &7plugin please wait a few second"
  46. make console execute command "/sk reload %script%"
  47. broadcast "&c&l%player%&7 has finished reloading sorry for the lag"
  48. else:
  49. message "&8==========[&c&lPVP Bot&8]==========" to player
  50. message "&7>&c/botsetup setspawn <bot/player/main>" to player
  51. message "&7>&c/botsetup setsign" to player
  52. message "&7>&c/botsetup reload" to player
  53. message "&7>&c/botsetup difficulty <easy/normal/hard>" to player
  54. message "&8==========[&c&lPVP Bot&8]==========" to player
  55. else:
  56. message "&7Nope :3" to player
  57.  
  58. on right click on a sign:
  59. if line 2 of event-block is "&8[&c&lPVP Bot&8]":
  60. if line 3 of event-block is "&f - &c&lJoin &f-":
  61. if {botarena.ingame} is not set:
  62. delete {botarena.player}
  63. set {botarena.ingame} to "ingame"
  64. make console execute command "/npc remove %{botarena.botid}%"
  65. delete {botarena.botid}
  66. heal the player
  67. set {botarena.player} to player
  68. create a citizen named "&c&lPVP Bot" at {botarena.spawn.bot}
  69. set {botarena.botid} to last created citizen id
  70. change citizen {botarena.botid} skin to "%player%"
  71. make console execute command "/npc select %{botarena.botid}%"
  72. make console execute command "/npc flyable false"
  73. teleport the player to {botarena.spawn.player}
  74. wait 1 tick
  75. make citizen {botarena.botid} vulnerable
  76. set slot 0 of citizen {botarena.botid} to stone sword
  77. if {botarena.difficulty} is "Easy":
  78. set {botarena.damage} to 0.6
  79. if {botarena.difficulty} is "Normal":
  80. set {botarena.damage} to 0.4
  81. if {botarena.difficulty} is "Hard":
  82. set {botarena.damage} to 0.2
  83. else:
  84. set {botarena.damage} to 0.4
  85. clear player's inventory
  86. set slot 0 of player to stone sword of unbreaking 50
  87. give 35 of mushroom soup to the player
  88. set player's gamemode to survival
  89. set {_num} to 3
  90. set {botarena.soups} to 0
  91. loop 3 times:
  92. teleport citizen {botarena.botid} to {botarena.spawn.bot}
  93. teleport the player to {botarena.spawn.player}
  94. message "&7Your fight agianst the PVP bot will start in&8: &c%{_num}%" to the player
  95. remove 1 from {_num}
  96. wait 1 second
  97. message "&7The battle has begun" to player
  98. loop 1000 times:
  99. set {_block} to location of player
  100. subtract 1 from y-coord of {_block}
  101. if block at {_block} is not air:
  102. move citizen {botarena.botid} to location of {botarena.player} at speed 1.5
  103. if distance between {botarena.player} and citizen {botarena.botid} is smaller than 4:
  104. make citizen {botarena.botid} look at location of {botarena.player}
  105. make citizen {botarena.botid} attack {botarena.player}
  106. wait 10 ticks
  107. else:
  108. message "&7This PVP bot is in used by&8: &c%{botarena.player}%" to the player
  109.  
  110. on hunger meter change:
  111. if {botarena.player} is player:
  112. cancel event
  113. on click with mushroom stew:
  114. if {botarena.player} is player:
  115. if health of player is less than 10:
  116. play raw sound "random.burp" at player with pitch 2 volume 0.5
  117. cancel event
  118. heal the player by 3.5 hearts
  119. set tool to bowl
  120.  
  121. on damage:
  122. if attacker's name is "&c&lPVP Bot":
  123. if {botarena.player} is not attacker:
  124. set damage to 2.0
  125. if victim's name is "&c&lPVP Bot":
  126. set damage to {botarena.damage}
  127. if {botarena.difficulty} is "Easy":
  128. chance of 20%:
  129. wait 2 ticks
  130. set slot 0 of citizen {botarena.botid} to mushroom stew
  131. wait 2 ticks
  132. set slot 0 of citizen {botarena.botid} to bowl
  133. add 1 to {botarena.soups}
  134. wait 2 ticks
  135. set slot 0 of citizen {botarena.botid} to stone sword
  136. if {botarena.difficulty} is "Normal":
  137. chance of 45%:
  138. wait 2 ticks
  139. set slot 0 of citizen {botarena.botid} to mushroom stew
  140. wait 2 ticks
  141. set slot 0 of citizen {botarena.botid} to bowl
  142. add 1 to {botarena.soups}
  143. wait 2 ticks
  144. set slot 0 of citizen {botarena.botid} to stone sword
  145. if {botarena.difficulty} is "Hard":
  146. chance of 75%:
  147. wait 2 ticks
  148. set slot 0 of citizen {botarena.botid} to mushroom stew
  149. wait 2 ticks
  150. set slot 0 of citizen {botarena.botid} to bowl
  151. add 1 to {botarena.soups}
  152. wait 2 ticks
  153. set slot 0 of citizen {botarena.botid} to stone sword
  154. else:
  155. chance of 20%:
  156. wait 2 ticks
  157. set slot 0 of citizen {botarena.botid} to mushroom stew
  158. wait 2 ticks
  159. add 1 to {botarena.soups}
  160. set slot 0 of citizen {botarena.botid} to bowl
  161. wait 2 ticks
  162. set slot 0 of citizen {botarena.botid} to stone sword
  163. push the victim downwards at speed 1.0
  164. push the victim backwards at speed 0.2
  165.  
  166. on death:
  167. if {botarena.player} is attacker:
  168. delete {botarena.ingame}
  169. delete {botarena.player}
  170. set death message to ""
  171. clear attacker's inventory
  172. wait 1 tick
  173. execute console command "npc select %{botarena.botid}%"
  174. execute console command "npc remove"
  175. loop all entities in radius 30 of victim:
  176. if loop-entity is item:
  177. clear loop-entity
  178. wait 1 tick
  179. set attacker's gamemode to survival
  180. teleport attacker to {botarena.spawn.main}
  181. wait 1 tick
  182. loop 3 times:
  183. wait 5 ticks
  184. shoot a firework from the attacker at speed 0.0
  185. heal the attacker
  186. broadcast "&c&l%attacker%&7 has won the battle against the &c&lPVP Bot"
  187. delete {botarena.player}
  188. on death:
  189. if {botarena.player} is victim:
  190. delete {botarena.ingame}
  191. delete {botarena.player}
  192. set {_health} to health of citizen {botarena.botid}
  193. message "&8================" to player
  194. message "&7>&c&lBot Health&8: &4&lā¤ %{_health}%" to player
  195. message "&7>&b&lBot Soups&8: &9&lā—‰ %{botarena.soups}%" to player
  196. message "&8================" to player
  197. execute console command "npc select %{botarena.botid}%"
  198. execute console command "npc remove"
  199.  
  200. on respawn:
  201. clear player's inventory
  202. wait 1 tick
  203. teleport player to {botarena.spawn.main}
  204.  
  205. on quit:
  206. if {botarena.player} is player:
  207. execute console command "npc select %{botarena.botid}%"
  208. execute console command "npc remove"
  209. delete {botarena.player}
  210. delete {botarena.bot}
  211. delete {botarena.ingame}
  212. on drop:
  213. if {botarena.player} is player:
  214. wait 25 ticks
  215. spawn 25 of particle smoke offset by 0.5, 0.5, 0.5 at event-entity's location
  216. clear event-entity
  217. on break:
  218. if {botarena.player} is player:
  219. cancel event
  220. on command:
  221. if {botarena.player} is player:
  222. cancel event
  223. message "&7You cannot execute commands while in game" to player
  224. on skript load:
  225. execute console command "npc select %{botarena.botid}%"
  226. execute console command "npc remove"
  227. teleport {botarena.player} to {botarena.spawn.main}
  228. clear {botarena.player}'s inventory
  229. delete {botarena.player}
  230. delete {botarena.bot}
  231. delete {botarena.ingame}
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement