Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #Duel Mode################
- command /duel <player>:
- description: Duels the specified player
- trigger:
- if {duelYes} is true:
- send "&f[&9Duel&f] &7There is already a duel going on!" to player
- stop
- else if {duelYes} is false:
- if {_duelercd.%player%} = 1:
- send "&f[&9Duel&f] &7You are on cooldown! Wait 30 seconds..." to player
- stop
- else:
- play raw sound "mob.enderdragon.growl" at player with pitch 1 volume 0.3
- set {_duelercd.%player%} to 1
- set {_dueler.%player%} to player
- set {_dueler2.%player%} to argument 1
- if {_dueler.%player%} is equal to {_dueler2.%player%}:
- send "&f[&9Duel&f] &7You can't duel yourself!"
- stop
- else:
- wait 1 tick
- #set {duelYes} to true#
- message "&f[&9Duel&f] &7Your duel request has been sent to &6%{_dueler2.%player%}%. &7Waiting for a response..."
- wait 1 tick
- send "&f[&9Duel&f] &7You have been challenged to a duel by &6%{_dueler.%player%}%. &7Would you like to accept this duel?" to argument 1
- play raw sound "mob.enderdragon.growl" at argument 1 with pitch 1 volume 0.3
- execute console command "/tellraw %{_dueler2.%player%}% ["""",{""text"":""["",""clickEvent"":{""action"":""run_command"",""value"":""""}},{""text"":""Yes"",""color"":""green"",""clickEvent"":{""action"":""run_command"",""value"":""/duelyes %{_dueler.%player%}% %{_dueler2.%player%}%""},""hoverEvent"":{""action"":""show_text"",""value"":{""text"":"""",""extra"":[{""text"":""Accept the Duel"",""color"":""green""}]}}},{""text"":""]"",""color"":""none""}]"
- execute console command "/tellraw %{_dueler2.%player%}% ["""",{""text"":""["",""clickEvent"":{""action"":""run_command"",""value"":""""}},{""text"":""No"",""color"":""red"",""clickEvent"":{""action"":""run_command"",""value"":""/duelno %{_dueler.%player%}%""},""hoverEvent"":{""action"":""show_text"",""value"":{""text"":"""",""extra"":[{""text"":""Deny the Duel"",""color"":""green""}]}}},{""text"":""]"",""color"":""none""}]"
- set {hasClicked::%{button.%player%}%} to false
- wait 30 seconds
- if {hasClicked::%{button.%player%}%} is false:
- send "&f[&9Duel&f] &6%{_dueler2.%player%}% &7did not take any action within 30 seconds. Cancelling..."
- make argument 1 execute command "/duelno %{_dueler.%player%}%"
- set {duelYes} to false
- stop
- else:
- wait 1 tick
- set {duelercd.%player%} to 0
- stop
- command /duelno <player>:
- trigger:
- set {_dueler.%player%} to argument 1
- set {_dueler2.%player%} to player
- if {hasClicked::%{button.%player%}%} is false:
- send "&f[&9Duel&f] &6%{_dueler2.%player%}% &7has declined the duel." to argument 1
- send "&f[&9Duel&f] &7You declined the duel." to {_dueler2.%player%}
- set {hasClicked::%{button.%player%}%} to true
- set {duelYes} to false
- set {_duelercd.%player%} to 1
- stop
- else:
- send "&f[&9Duel&f] &7You don't have a duel to decline." to {_dueler2.%player%}
- command /duelyes <player> <player>:
- trigger:
- set {_dueler.%player%} to argument 1
- set {_dueler2.%player%} to argument 2
- if {hasClicked::%{button.%player%}%} is false:
- play raw sound "random.pop" at argument 1 with pitch 1 volume 0.3
- play raw sound "random.pop" at argument 2 with pitch 1 volume 0.3
- send "&f[&9Duel&f] &6%{_dueler2.%player%}% &7has accepted the duel." to argument 1
- send "&f[&9Duel&f] &7You accepted the duel." to argument 2
- set {hasClicked::%{button.%player%}%} to true
- set {duelYes} to true
- wait 1 second
- make argument 1 execute command "/duelspecnot %{_dueler.%player%}% %{_dueler2.%player%}%"
- send "&f[&9Duel&f] &715 seconds until teleportation..." to argument 1
- send "&f[&9Duel&f] &715 seconds until teleportation..." to argument 2
- play raw sound "random.orb" at argument 1 with pitch 1 volume 0.3
- play raw sound "random.orb" at argument 2 with pitch 1 volume 0.3
- wait 5 seconds
- send "&f[&9Duel&f] &710 seconds until teleportation..." to argument 1
- send "&f[&9Duel&f] &710 seconds until teleportation..." to argument 2
- play raw sound "random.orb" at argument 1 with pitch 1 volume 0.3
- play raw sound "random.orb" at argument 2 with pitch 1 volume 0.3
- wait 5 seconds
- send "&f[&9Duel&f] &75 seconds until teleportation..." to argument 1
- send "&f[&9Duel&f] &75 seconds until teleportation..." to argument 2
- play raw sound "random.orb" at argument 1 with pitch 1 volume 0.3
- play raw sound "random.orb" at argument 2 with pitch 1 volume 0.3
- wait 5 seconds
- send "&f[&9Duel&f] &7Teleporting..." to argument 1
- send "&f[&9Duel&f] &7Teleporting..." to argument 2
- play raw sound "random.pop" at argument 1 with pitch 1 volume 0.3
- play raw sound "random.pop" at argument 2 with pitch 1 volume 0.3
- wait 1 second
- make argument 1 execute command "/dueltps"
- make argument 2 execute command "/dueltp"
- wait 1 second
- set {duelStart} to true
- set {_dueler.%player%} to argument 1
- set {_dueler2.%player%} to argument 2
- set {score2.%{_dueler.%player%}%} to 0
- set {score1.%{_dueler.%player%}%} to 0
- make argument 1 execute command "/duelcheck %{_dueler.%player%}% %{_dueler2.%player%}%"
- else:
- play raw sound "tile.piston.in" at argument 2 with pitch 1 volume 0.3
- send "&f[&9Duel&f] &7You don't have a duel to accept." to {_dueler2.%player%}
- command /duelcheck <player> <player>:
- trigger:
- set {_dueler.%player%} to argument 1
- set {_dueler2.%player%} to argument 2
- wait 1 tick
- wait 1 second
- make argument 1 execute command "/dueltps"
- make argument 2 execute command "/dueltp"
- apply potion of slowness 10 to {_dueler.%player%} for 5 seconds
- apply potion of slowness 10 to {_dueler2.%player%} for 5 seconds
- wait 1 tick
- send "&f[&9Duel&f] &75 seconds until start..." to argument 1
- send "&f[&9Duel&f] &75 seconds until start..." to argument 2
- play raw sound "random.orb" at argument 1 with pitch 1 volume 0.3
- play raw sound "random.orb" at argument 2 with pitch 1 volume 0.3
- wait 1 second
- send "&f[&9Duel&f] &74 seconds until start..." to argument 1
- send "&f[&9Duel&f] &74 seconds until start..." to argument 2
- play raw sound "random.orb" at argument 1 with pitch 1 volume 0.3
- play raw sound "random.orb" at argument 2 with pitch 1 volume 0.3
- wait 1 second
- send "&f[&9Duel&f] &73 seconds until start..." to argument 1
- send "&f[&9Duel&f] &73 seconds until start..." to argument 2
- play raw sound "random.orb" at argument 1 with pitch 1 volume 0.3
- play raw sound "random.orb" at argument 2 with pitch 1 volume 0.3
- wait 1 second
- send "&f[&9Duel&f] &72 seconds until start..." to argument 1
- send "&f[&9Duel&f] &72 seconds until start..." to argument 2
- play raw sound "random.orb" at argument 1 with pitch 1 volume 0.3
- play raw sound "random.orb" at argument 2 with pitch 1 volume 0.3
- wait 1 second
- send "&f[&9Duel&f] &71 seconds until start..." to argument 1
- send "&f[&9Duel&f] &71 seconds until start..." to argument 2
- play raw sound "random.orb" at argument 1 with pitch 1 volume 0.3
- play raw sound "random.orb" at argument 2 with pitch 1 volume 0.3
- wait 1 second
- send "&f[&9Duel&f] &7The Duel begins, fight with honor &c%{_dueler.%player%}% &7and &9%{_dueler2.%player%}%!" to argument 1
- send "&f[&9Duel&f] &7The Duel begins, fight with honor &c%{_dueler.%player%}% &7and &9%{_dueler2.%player%}%!" to argument 2
- play raw sound "random.pop" at argument 1 with pitch 1 volume 0.3
- play raw sound "random.pop" at argument 2 with pitch 1 volume 0.3
- make argument 1 execute command "/dueltps"
- make argument 2 execute command "/dueltp"
- wait 1 second
- loop 120 times:
- loop all players:
- set {dueler.%loop-player%} to argument 1
- set {dueler2.%loop-player%} to argument 2
- if {dueler.%loop-player%} is dead:
- send "&f[&9Duel&f] &9%{_dueler2.%player%}% &7has won the round!" to argument 1
- send "&f[&9Duel&f] &9%{_dueler2.%player%}% &7has won the round!" to argument 2
- play raw sound "random.levelup" at argument 1 with pitch 1 volume 0.3
- play raw sound "random.levelup" at argument 2 with pitch 1 volume 0.3
- wait 2 seconds
- make argument 1 execute command "/duelscore %{_dueler.%player%}% %{_dueler2.%player%}%"
- stop
- else if {dueler2.%loop-player%} is dead:
- send "&f[&9Duel&f] &c%{_dueler.%player%}% &7has won the round!" to argument 1
- send "&f[&9Duel&f] &c%{_dueler.%player%}% &7has won the round!" to argument 2
- play raw sound "random.levelup" at argument 1 with pitch 1 volume 0.3
- play raw sound "random.levelup" at argument 2 with pitch 1 volume 0.3
- make argument 1 execute command "/duelerscore %{_dueler.%player%}% %{_dueler2.%player%}%"
- stop
- wait 1 second
- wait 1 second
- send "&f[&9Duel&f] &7The duel has taken too long, ending..." to argument 1
- send "&f[&9Duel&f] &7The duel has taken too long, ending..." to argument 2
- wait 1 second
- broadcast "&f[&9Duel&f] &7The Duel ended in a draw!"
- wait 1 second
- make argument 1 execute command "/spawn"
- make argument 2 execute command "/spawn"
- set {duelStart} to false
- set {duelYes} to false
- set {score1} to 0
- set {score2} to 0
- stop
- command /dueltp:
- trigger:
- execute console command "/warp duel2 %player%"
- command /dueltps:
- trigger:
- execute console command "/warp duel1 %player%"
- command /duelend:
- permission: kukky.duel
- trigger:
- set {duelYes} to false
- set {duelStart} to false
- set {score1} to 0
- set {score2} to 0
- send "&f[&9Duel&f] &cYou have forced the duel to end."
- command /duelscore <player> <player>:
- trigger:
- set {_dueler.%player%} to argument 1
- set {_dueler2.%player%} to argument 2
- wait 1 tick
- if argument 1 is {_dueler2.%player%}:
- wait 1 second
- add 1 to {score1}
- send "&f[&9Duel&f] &cYour score went up by 1." to argument 1
- else if argument 1 is {_dueler.%player%}:
- wait 1 second
- add 1 to {score2}
- send "&f[&9Duel&f] &9Your score went up by 1." to argument 2
- wait 1 second
- send "&f[&9Duel&f] &7The score is now &c%{score1}% &7to &9%{score2}%&7!" to argument 1
- send "&f[&9Duel&f] &7The score is now &c%{score1}% &7to &9%{score2}%&7!" to argument 2
- play raw sound "random.pop" at argument 1 with pitch 1 volume 0.3
- play raw sound "random.pop" at argument 2 with pitch 1 volume 0.3
- wait 1 second
- if {score1} is 2:
- #send "&f[&9Duel&f] &c%{_dueler.%player%}% &7has won the duel!" to argument 1#
- #send "&f[&9Duel&f] &c%{_dueler.%player%}% &7has won the duel!" to argument 2#
- play raw sound "random.levelup" at argument 1 with pitch 1 volume 0.3
- play raw sound "random.levelup" at argument 2 with pitch 1 volume 0.3
- wait 1 second
- make argument 1 execute command "/spawn"
- make argument 2 execute command "/spawn"
- set {duelStart} to false
- set {duelYes} to false
- clear {score1}
- clear {score2}
- stop
- else if {score2} is 2:
- #send "&f[&9Duel&f] &9%{_dueler2.%player%}% &7has won the duel!" to argument 1#
- #send "&f[&9Duel&f] &9%{_dueler2.%player%}% &7has won the duel!" to argument 2#
- broadcast "&f[&9Duel&f] &c%{_dueler2.%player%}% &7has won the duel!"
- play raw sound "random.levelup" at argument 1 with pitch 1 volume 0.3
- play raw sound "random.levelup" at argument 2 with pitch 1 volume 0.3
- wait 1 second
- make argument 1 execute command "/spawn"
- make argument 2 execute command "/spawn"
- set {duelStart} to false
- set {duelYes} to false
- clear {score1}
- clear {score2}
- stop
- wait 1 tick
- make argument 1 execute command "/duelcheck %{_dueler.%player%}% %{_dueler2.%player%}%"
- stop
- command /duelerscore <player> <player>:
- trigger:
- set {_dueler.%player%} to argument 1
- set {_dueler2.%player%} to argument 2
- wait 1 tick
- if argument 1 is {_dueler.%player%}:
- wait 1 second
- add 1 to {score1}
- send "&f[&9Duel&f] &cYour score went up by 1." to argument 1
- else if argument 1 is {_dueler2.%player%}:
- wait 1 second
- add 1 to {score2}
- send "&f[&9Duel&f] &9Your score went up by 1." to argument 1
- wait 1 tick
- send "&f[&9Duel&f] &7The score is now &c%{score1}% &7to &9%{score2}%&7!" to argument 1
- send "&f[&9Duel&f] &7The score is now &c%{score1}% &7to &9%{score2}%&7!" to argument 2
- play raw sound "random.pop" at argument 1 with pitch 1 volume 0.3
- play raw sound "random.pop" at argument 2 with pitch 1 volume 0.3
- wait 1 second
- if {score1} is 2:
- #send "&f[&9Duel&f] &c%{_dueler.%player%}% &7has won the duel!" to argument 1#
- #send "&f[&9Duel&f] &c%{_dueler.%player%}% &7has won the duel!" to argument 2#
- broadcast "&f[&9Duel&f] &c%{_dueler.%player%}% &7has won the duel!"
- play raw sound "random.levelup" at argument 1 with pitch 1 volume 0.3
- play raw sound "random.levelup" at argument 2 with pitch 1 volume 0.3
- wait 1 second
- make argument 1 execute command "/spawn"
- make argument 2 execute command "/spawn"
- set {duelStart} to false
- set {duelYes} to false
- set {score1} to 0
- set {score2} to 0
- stop
- else if {score2} is 2:
- #send "&f[&9Duel&f] &9%{_dueler2.%player%}% &7has won the duel!" to argument 1#
- #send "&f[&9Duel&f] &9%{_dueler2.%player%}% &7has won the duel!" to argument 2#
- broadcast "&f[&9Duel&f] &c%{_dueler.%player%}% &7has won the duel!"
- play raw sound "random.levelup" at argument 1 with pitch 1 volume 0.3
- play raw sound "random.levelup" at argument 2 with pitch 1 volume 0.3
- wait 1 second
- make argument 1 execute command "/spawn"
- make argument 2 execute command "/spawn"
- set {duelStart} to false
- set {duelYes} to false
- clear {score1}
- clear {score2}
- stop
- wait 1 tick
- make argument 1 execute command "/duelcheck %{_dueler.%player%}% %{_dueler2.%player%}%"
- stop
- command /duelspecnot <player> <player>:
- trigger:
- set {_dueler.%player%} to argument 1
- set {_dueler2.%player%} to argument 2
- if {duelYes} is true:
- loop all players:
- wait 1 tick
- send "&f[&9Duel&f] &c%{_dueler.%player%}% &7and &9%{_dueler2.%player%}% &7are duelling!" to loop-player
- execute console command "/tellraw %loop-player% ["""",{""text"":""["",""clickEvent"":{""action"":""run_command"",""value"":""""}},{""text"":""Spectate the Duel"",""color"":""blue"",""clickEvent"":{""action"":""run_command"",""value"":""/duelspec""},""hoverEvent"":{""action"":""show_text"",""value"":{""text"":"""",""extra"":[{""text"":""Spectate the Duel"",""color"":""light gray""}]}}},{""text"":""]"",""color"":""none""}]"
- else:
- stop
- command /duelspec:
- trigger:
- execute console command "/warp duelspectate %player%"
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement