kazuken0814

Untitled

Jun 24th, 2018
94
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.09 KB | None | 0 0
  1. command /get-swap:
  2. permission: a
  3. trigger:
  4. give a cat disc with nbt "{display:{Name:""&bSwapper &aREADY"",Lore:[""&6Class Item""]}}" to player
  5. on join:
  6. delete {Swap.%player%}
  7. every a second:
  8. loop all players:
  9. if {Swap.%loop-player%} is set:
  10. set {_c} to difference between {Swap.%loop-player%} and now
  11. if {_c} is less than 20 seconds:
  12. set {__c} to difference between 20 seconds and {_c}
  13. set {___c} to "%{__c}%"
  14. replace all " seconds" in {___c} with ""
  15. replace all " second" in {___c} with ""
  16. set {_s::*} to {___c} split at "."
  17. if loop-player's tool is cat disc:
  18. if name of loop-player's tool contains "&bSwapper":
  19. set the name of loop-player's tool to "&bSwapper &c%{_s::1}%"
  20. stop
  21. delete {Swap.%loop-player%}
  22. else:
  23. if loop-player's tool is cat disc:
  24. if name of loop-player's tool contains "&bSwapper":
  25. set the name of loop-player's tool to "&bSwapper &aREADY"
  26. on right click holding cat disc:
  27. if name of player's tool is "&bSwapper &aREADY":
  28. if target player is set:
  29. if {team.%player%} is not {team.%target player%}:
  30. if distance between the player and player's targeted player is smaller than 20:
  31. set {_sw} to location of player
  32. set {_target} to target player
  33. teleport player to {_target}
  34. teleport {_target} to {_sw}
  35. show 50 Fireworks Spark particles at location of player offset by 0, 0, 0 at speed 0.1
  36. show 50 Fireworks Spark particles at location of {_target} offset by 0, 0, 0 at speed 0.1
  37. set {Swap.%player%} to now
  38. if {team.%{_target}%} is "red":
  39. send "&bSwapped with &c%{_target}%" to player
  40. if {team.%{_target}%} is "blue":
  41. send "&bSwapped with &9%{_target}%" to player
  42. if {team.%player%} is "red":
  43. send "&c%player% &bswapped you!" to {_target}
  44. if {team.%player%} is "blue":
  45. send "&9%player% &bswapped you!" to {_target}
  46. play raw sound "mob.endermen.portal" at player with pitch 2 volume 1
  47. play raw sound "mob.endermen.portal" at {_target} with pitch 2 volume 1
  48. set the name of player's tool to "&bSwapper &c20"
Advertisement
Add Comment
Please, Sign In to add comment