Guest User

Track.sk

a guest
Jun 3rd, 2022
118
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.22 KB | None | 0 0
  1. # Set track-player command
  2. command /track <player>:
  3. permission: track.use
  4. permission message: &cNo permission!
  5. trigger:
  6. set {targetplayer} to arg 1
  7. broadcast "&eThe target has been changed to &l%{targetplayer}%"
  8.  
  9. # Start manhunt command
  10. command /manhuntstart:
  11. permission: track.use
  12. permission message: &cNo permission!
  13. trigger:
  14. broadcast "&8&l[&a&lManhunt&8&l] &a&lManhunt game has initiated, the game starts as soon as the target moves"
  15. loop all players:
  16. loop-player is not {targetplayer}:
  17. set gamemode of loop-player to survival
  18. clear loop-player's inventory
  19. give compass to loop-player
  20. heal loop-player
  21. loop-player is {targetplayer}:
  22. set gamemode of loop-player to survival
  23. clear loop-player's inventory
  24. heal loop-player
  25. set {gameactive} to true
  26. make console execute command "/time set day"
  27. make console execute command "/weather clear"
  28. make console execute command "/kill @e[type=!player]"
  29. make console execute command "/kill @e[type=!player]"
  30. loop {spectator::*}:
  31. set gamemode of loop-value to spectator
  32. send "&8&l[&a&lManhunt&8&l] &aYou are now a spectator until the end of the game!" to loop-value
  33.  
  34.  
  35. on join:
  36. if {gameactive} is true:
  37. set gamemode of player to spectator
  38. send "&8&l[&a&lManhunt&8&l] &eWelcome! Right now, there is a game active, this means you are in spectator mode and cannot interact. Once the game has finished you will be set into survival mode."
  39.  
  40. # Track player command
  41. command /targetcompass:
  42. permission: track.use
  43. permission message: &cNo permission!
  44. trigger:
  45. set player's compass target to location of {targetplayer}
  46.  
  47. # Track player
  48. on rightclick with a compass:
  49. if {trackmode.%player%} is not set:
  50. if player and {targetplayer} is in world "world":
  51. set {trackmode.%player%} to true
  52. enchant player's held item with unbreaking 1
  53. set name of player's held item to "&eTracking %{targetplayer}%"
  54. send "&8&l[&a&lManhunt&8&l] &eCompass is pointing to %{targetplayer}%"
  55. stop
  56. else if player is in world "world":
  57. send "&8&l[&a&lManhunt&8&l] &c%{targetplayer}% is not in the overworld"
  58. else:
  59. send "&8&l[&a&lManhunt&8&l] &cThe compass does not work in this dimension"
  60. else:
  61. delete {trackmode.%player%}
  62. disenchant player's held item
  63. set player's compass target to spawn
  64. set name of player's held item to ""
  65. stop
  66.  
  67. every 2 seconds:
  68. loop all players:
  69. if {trackmode.%loop-player%} = true:
  70. set loop-player's compass target to location of {targetplayer}
  71.  
  72. # Game end
  73. on death:
  74. if victim is {targetplayer}:
  75. broadcast "&8&l[&a&lManhunt&8&l] &a&l%victim% has died, Hunters win!"
  76. delete {targetplayer}
  77. loop all players:
  78. delete {trackmode.%loop-player%}
  79. loop {spectator::*}:
  80. set gamemode of loop-value to survival
  81. send "&8&l[&a&lManhunt&8&l] &fThe game ended, you are now in survival mode again!" to loop-value
  82. kill loop-value
  83. delete {spectator::*}
Advertisement
Add Comment
Please, Sign In to add comment