Advertisement
kama6012

ZombieGameCore

Mar 29th, 2019
153
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 5.55 KB | None | 0 0
  1. command /zm [<text="join">] [<integer>]:
  2. trigger:
  3. if arg-1 is "join":
  4. if {zm::limit::%player%} don't exist:
  5. set {zm::limit::%player%} to 2
  6. if {zm::game} is not set:
  7. set {zm::join::%player%} to true
  8. set {_player} to 0
  9. loop {zm::join::*}:
  10. set {_player} to {_player} + 1
  11. {_player} is 1
  12. broadcast "&r[ZM]ゾンビゲームが20秒後にスタートします。"
  13. wait 20 second
  14. #ゲームスタート
  15. set {zm::game} to true
  16. set {zm::spawnlist::0} to location at 53, 62, 60
  17. loop {zm::join::*}:
  18. teleport loop-index parsed as player to location at 32, 62, 60
  19. message "&r[ZM]ゲームが始まりました。ゾンビが来ます。" to loop-index parsed as player
  20. set {_round} to 0
  21. loop 30 times:
  22. broadcast "&r&l[ZM]ラウンドスタート。"
  23. set {_round} to {_round} + 1
  24. set {_list} to 0
  25. loop {zm::spawnlist::*}:
  26. add 1 to {_list}
  27. if {_round} is 10:
  28. set {_random} to random integer between 0 and {_list}
  29. spawn 1 creeper at {zm::spawnlist::%{_random}%}
  30. else if {_round} is 20:
  31. set {_random} to random integer between 0 and {_list}
  32. spawn 1 creeper at {zm::spawnlist::%{_random}%}
  33. else if {_round} is 30:
  34. set {_random} to random integer between 0 and {_list}
  35. spawn 1 zombie at {zm::spawnlist::%{_random}%}
  36. else:
  37. loop {_round}*8 times:
  38. set {_random} to random integer between 0 and {_list}
  39. spawn 1 zombie at {zm::spawnlist::%{_random}%}
  40. set last spawned entity's tool to gold nugget with no NBT
  41. add "{AttributeModifiers:[{AttributeName:""generic.attackDamage"",Name:""generic.attackDamage"",Amount:10,Operation:0,UUIDLeast:969024,UUIDMost:307421,Slot:""mainhand""}],display:{Name:""§rZombie Coin""}}" to nbt of last spawned entity's tool
  42. set last spawned entity's max health to 20 + ({_round}*10)
  43. set last spawned entity's walk speed to 0.05 + ({_round}*0.4)
  44. heal last spawned entity
  45. delete {_player}
  46. loop {zm::join::*}:
  47. set {_player} to true
  48. if {_player} is not set:
  49. broadcast "&4&l[ZM]誰もいなくなりました。GAME OVER"
  50. delete {zm::join::*}
  51. delete {zm::limit::*}
  52. delete {zm::spawnlist::*}
  53. delete {zm::game}
  54. loop all zombies in radius 50 around location at 32, 62, 60:
  55. kill loop-entity
  56. set block at location at 32, 63, 72 to sign
  57. set 1st line of block at location at 32, 63, 72 to "&k&rZombie"
  58. set 2nd line of block at location at 32, 63, 72 to "1"
  59. set block at location at 32, 62, 73 to oak plank
  60. set block at location at 32, 63, 73 to oak plank
  61. stop
  62. loop 200 times:
  63. delete {_zm::zombie}
  64. wait 5 second
  65. loop all zombies in radius 50 around location at 32, 62, 60:
  66. set {_zm::zombie} to {_zm::zombie} + 1
  67. delete {_player}
  68. loop {zm::join::*}:
  69. set {_player} to true
  70. if {_player} is not set:
  71. broadcast "&4&l[ZM]誰もいなくなりました。GAME OVER"
  72. delete {zm::join::*}
  73. delete {zm::limit::*}
  74. delete {zm::spawnlist::*}
  75. delete {zm::game}
  76. loop all zombies in radius 50 around location at 32, 62, 60:
  77. kill loop-entity
  78. set block at location at 32, 63, 72 to sign
  79. set 1st line of block at location at 32, 63, 72 to "&k&rZombie"
  80. set 2nd line of block at location at 32, 63, 72 to "1"
  81. set block at location at 32, 62, 73 to oak plank
  82. set block at location at 32, 63, 73 to oak plank
  83. stop
  84. {_zm::zombie} is not set
  85. exit this loop
  86. if {_zm::zombie} is set:
  87. broadcast "&r&l[ZM]1000秒が経過しました。時間がかかりすぎです。"
  88. broadcast "&r&l[ZM]ラウンド終了。10秒待ってください。"
  89. wait 10 second
  90. broadcast "&r[ZM]30ラウンドがすべてクリアされました。"
  91. loop {zm::join::*}:
  92. teleport loop-index parsed as player to location at 8, 63, 8
  93. delete {zm::join::*}
  94. delete {zm::limit::*}
  95. delete {zm::spawnlist::*}
  96. delete {zm::game}
  97. loop all zombies in radius 50 around location at 32, 62, 60:
  98. kill loop-entity
  99. set block at location at 32, 63, 72 to sign
  100. set 1st line of block at location at 32, 63, 72 to "&k&rZombie"
  101. set 2nd line of block at location at 32, 63, 72 to "1"
  102. set block at location at 32, 62, 73 to oak plank
  103. set block at location at 32, 63, 73 to oak plank
  104. stop
  105. else:
  106. {zm::join::%player%} is not set
  107. if {zm::limit::%player%} > 0:
  108. set {zm::limit::%player%} to {zm::limit::%player%} - 1
  109. teleport player to location at 32, 62, 60
  110. set {zm::join::%player%} to true
  111. else:
  112. message "&r&l[ZM]復活可能回数が0です。復活できません。"
  113. else if arg-1 is "open":
  114. if arg-2 is 2:
  115. player has 100 gold nugget named "&rZombie Coin"
  116. remove 100 gold nugget named "&rZombie Coin" from player's inventory
  117. if arg-2 is 3:
  118. player has 200 gold nugget named "&rZombie Coin"
  119. remove 200 gold nugget named "&rZombie Coin" from player's inventory
  120. else if arg-1 is "reset":
  121. delete {zm::join::*}
  122. delete {zm::limit::*}
  123. delete {zm::spawnlist::*}
  124. delete {zm::game}
  125.  
  126. on death of player:
  127. delete {zm::join::%player%}
  128.  
  129. on quit:
  130. delete {zm::join::%player%}
  131.  
  132. on pick up:
  133. event-item is gold nugget named "&rZombie Coin"
  134. wait 1 tick
  135. remove event-item from player's inventory
  136. give player event-item's item amount of gold nugget named "&rZombie Coin"
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement