pewax

TD Plugin

Apr 3rd, 2016
206
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.66 KB | None | 0 0
  1. #
  2. # Tower Defence game in minecraft!
  3. #
  4.  
  5. variables:
  6. {castlehealth} = 20
  7. {score} = 0
  8.  
  9. # This is where the commands for tower defence will be kept!
  10.  
  11. # This command sets the end for the zombies to go to!
  12. command /tdend:
  13. trigger:
  14. set {end} to location of player
  15. message "&aYou have set the end zone for the zombies!"
  16.  
  17. # This command sets the spawn for the zombies!
  18. command /tdspawn:
  19. trigger:
  20. set {spawn} to location of player
  21. message "&aYou have set the spawn for the zombies!"
  22.  
  23. # This command is a test command for spawning zombies!
  24. command /zspawn:
  25. trigger:
  26. if {spawn} is not set:
  27. message "&4You have not set a spawn location &a(/tdspawn)"
  28. set {zombie} to a zombie
  29. spawn a zombie at {spawn}
  30.  
  31. # This tests for if a zombie has reached the end! (test command)
  32. command /tdendtest:
  33. trigger:
  34. if {died} is set:
  35. broadcast "&4You have lost a life!"
  36. kill {died}
  37.  
  38. # -------------------------------------------------------------------------------
  39.  
  40. # This is where the towers are!
  41.  
  42. on right click with stick:
  43. clicked block is obsidian:
  44. set {mobguard.%uuid of player%} to location of clicked block
  45. set block above clicked block to wool
  46.  
  47. every 3 seconds:
  48. loop all players:
  49. loop all entities in radius 10 around {mobguard.%uuid of loop-player-1%}:
  50. loop-entity-2 is zombie:
  51. broadcast "Zombie detected!"
  52. else:
  53. broadcast "Mob detected, but no zombie."
  54.  
  55. on death of a zombie:
  56. set {_player} to player
  57. add 1 to {score}
  58. broadcast "&aYou have &3%{score}% &apoints"
  59.  
  60. on spawn of zombie:
  61. set name of spawned zombie to "Zombie"
Advertisement
Add Comment
Please, Sign In to add comment