Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- command /get-swap:
- permission: a
- trigger:
- give a cat disc with nbt "{display:{Name:""&bSwapper &aREADY"",Lore:[""&6Class Item""]}}" to player
- on join:
- delete {Swap.%player%}
- every a second:
- loop all players:
- if {Swap.%loop-player%} is set:
- set {_c} to difference between {Swap.%loop-player%} and now
- if {_c} is less than 20 seconds:
- set {__c} to difference between 20 seconds and {_c}
- set {___c} to "%{__c}%"
- replace all " seconds" in {___c} with ""
- replace all " second" in {___c} with ""
- set {_s::*} to {___c} split at "."
- if loop-player's tool is cat disc:
- if name of loop-player's tool contains "&bSwapper":
- set the name of loop-player's tool to "&bSwapper &c%{_s::1}%"
- stop
- delete {Swap.%loop-player%}
- else:
- if loop-player's tool is cat disc:
- if name of loop-player's tool contains "&bSwapper":
- set the name of loop-player's tool to "&bSwapper &aREADY"
- on right click holding cat disc:
- if name of player's tool is "&bSwapper &aREADY":
- if target player is set:
- if {team.%player%} is not {team.%target player%}:
- if distance between the player and player's targeted player is smaller than 20:
- set {_sw} to location of player
- set {_target} to target player
- teleport player to {_target}
- teleport {_target} to {_sw}
- show 50 Fireworks Spark particles at location of player offset by 0, 0, 0 at speed 0.1
- show 50 Fireworks Spark particles at location of {_target} offset by 0, 0, 0 at speed 0.1
- set {Swap.%player%} to now
- if {team.%{_target}%} is "red":
- send "&bSwapped with &c%{_target}%" to player
- if {team.%{_target}%} is "blue":
- send "&bSwapped with &9%{_target}%" to player
- if {team.%player%} is "red":
- send "&c%player% &bswapped you!" to {_target}
- if {team.%player%} is "blue":
- send "&9%player% &bswapped you!" to {_target}
- play raw sound "mob.endermen.portal" at player with pitch 2 volume 1
- play raw sound "mob.endermen.portal" at {_target} with pitch 2 volume 1
- set the name of player's tool to "&bSwapper &c20"
Advertisement
Add Comment
Please, Sign In to add comment