Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #=============#
- # Duels #
- #=============#
- #Options:
- options:
- C: 7 #Duel Command Cooldown
- T: &c<bold>Choose the Duel Type! #Description of the Chest Inventory
- S: 3 #Time to start the duel Seconds
- EC: true #Ender Pearl Cooldown (True or False)
- ECT: 15 #Ender Pearl Cooldown Time Seconds
- I: iron sword #item to open the match types
- IN: &6Match Queue #Name of the item to open the match types
- Q: glowstone dust #Item to leave queue
- QN: &6Leave Queue #Name of item to leave queue
- #Commands:
- command /duel <player> [<text>]:
- permission: duel.duel
- permission message: &cYou don't have permission for that.
- trigger:
- if {PlayerInTeam::%player%} is set:
- message "&7You are in a team."
- stop
- if {PlayerInTeam::%player%} is not set:
- if {PlayerInTeam::%player argument%} is set:
- message "&7That player is in a team."
- stop
- if {PlayerInTeam::%player argument%} is not set:
- if {intour.%player%.true} is true:
- message "&7You cannot do that if you are in a tournament!"
- stop
- else:
- if {intour.%player argument%.true} is true:
- message "&7That player is in a tournament!"
- stop
- else:
- clear {wanted.%player%}
- wait 1 tick
- set {wanted.%player%} to player argument
- if arg-2 is not set:
- if {duel.%player argument%.ingame} is true:
- send "&b%player argument% &7<bold>is in a duel" to player
- stop
- if {duel.%player argument%.ingame} is false:
- if {duel.%player%.ingame} is true:
- send "&7You are in a duel" to player
- stop
- if {duel.%player%.ingame} is false:
- if player argument is player:
- send "&7You cannot duel yourself" to player
- stop
- if player argument is not player:
- set {_type.0} to 0
- set {_type.1} to 1
- set {_type.2} to 2
- set {_type.3} to 3
- set {_type.4} to 4
- set {_type.5} to 5
- set {_type.6} to 6
- set {_type.7} to 7
- set {_type.8} to 8
- open chest with 1 row named "{@T}" to player
- if {typeset::%{_type.0}%} is set:
- format slot {_type.0} of player with {slot.%{_type.0}%.item} named "&7<bold>%{slot.%{_type.0}%.name}%" to close then run [make player execute command "duel %{wanted.%player%}% %{slot.%{_type.0}%.name}%"]
- if {typeset::%{_type.0}%} is not set:
- format slot {_type.0} of player with air named "" to be unstealable
- if {typeset::%{_type.1}%} is set:
- format slot {_type.1} of player with {slot.%{_type.1}%.item} named "&7<bold>%{slot.%{_type.1}%.name}%" to close then run [make player execute command "duel %{wanted.%player%}% %{slot.%{_type.1}%.name}%"]
- if {typeset::%{_type.1}%} is not set:
- format slot {_type.1} of player with air named "" to be unstealable
- if {typeset::%{_type.2}%} is set:
- format slot {_type.2} of player with {slot.%{_type.2}%.item} named "&7<bold>%{slot.%{_type.2}%.name}%" to close then run [make player execute command "duel %{wanted.%player%}% %{slot.%{_type.2}%.name}%"]
- if {typeset::%{_type.2}%} is not set:
- format slot {_type.2} of player with air named "" to be unstealable
- if {typeset::%{_type.3}%} is set:
- format slot {_type.3} of player with {slot.%{_type.3}%.item} named "&7<bold>%{slot.%{_type.3}%.name}%" to close then run [make player execute command "duel %{wanted.%player%}% %{slot.%{_type.3}%.name}%"]
- if {typeset::%{_type.3}%} is not set:
- format slot {_type.3} of player with air named "" to be unstealable
- if {typeset::%{_type.4}%} is set:
- format slot {_type.4} of player with {slot.%{_type.4}%.item} named "&7<bold>%{slot.%{_type.4}%.name}%" to close then run [make player execute command "duel %{wanted.%player%}% %{slot.%{_type.4}%.name}%"]
- if {typeset::%{_type.4}%} is not set:
- format slot {_type.4} of player with air named "" to be unstealable
- if {typeset::%{_type.5}%} is set:
- format slot {_type.5} of player with {slot.%{_type.5}%.item} named "&7<bold>%{slot.%{_type.5}%.name}%" to close then run [make player execute command "duel %{wanted.%player%}% %{slot.%{_type.5}%.name}%"]
- if {typeset::%{_type.5}%} is not set:
- format slot {_type.5} of player with air named "" to be unstealable
- if {typeset::%{_type.6}%} is set:
- format slot {_type.6} of player with {slot.%{_type.6}%.item} named "&7<bold>%{slot.%{_type.6}%.name}%" to close then run [make player execute command "duel %{wanted.%player%}% %{slot.%{_type.6}%.name}%"]
- if {typeset::%{_type.6}%} is not set:
- format slot {_type.6} of player with air named "" to be unstealable
- if {typeset::%{_type.7}%} is set:
- format slot {_type.7} of player with {slot.%{_type.7}%.item} named "&7<bold>%{slot.%{_type.7}%.name}%" to close then run [make player execute command "duel %{wanted.%player%}% %{slot.%{_type.7}%.name}%"]
- if {typeset::%{_type.7}%} is not set:
- format slot {_type.7} of player with air named "" to be unstealable
- if {typeset::%{_type.8}%} is set:
- format slot {_type.8} of player with {slot.%{_type.8}%.item} named "&7<bold>%{slot.%{_type.8}%.name}%" to close then run [make player execute command "duel %{wanted.%player%}% %{slot.%{_type.8}%.name}%"]
- if {typeset::%{_type.8}%} is not set:
- format slot {_type.8} of player with air named "" to be unstealable
- if arg-2 is set:
- if {dueltype::%arg-2%} is set:
- if {duel.%player argument%.ingame} is true:
- send "&b%player argument% &7<bold>is in a duel" to player
- stop
- if {duel.%player argument%.ingame} is false:
- if {duel.%player%.ingame} is true:
- send "&7You are in a duel" to player
- stop
- if {duel.%player%.ingame} is false:
- if player argument is player:
- send "&7You cannot duel yourself" to player
- stop
- if player argument is not player:
- set {_cooldown} to difference between {duel.%player%.lastused} and now
- if {_cooldown} is less than {@C} seconds:
- set {_cooldown} to difference between {_cooldown} and {@C} seconds
- wait 1 tick
- message "&b%{_cooldown}% &7<bold>seconds left" to player
- stop trigger
- else:
- set {duel.%player%.lastused} to now
- delete {reqs.%player argument%::%player%}
- clear {reqs.%player argument%::%player%::*}
- wait 2 tick
- set {reqs.%player argument%::%player%} to player
- set {reqs.%player argument%::%player%::%arg-2%} to arg-2
- set {duel.%player argument%.req} to true
- send "&7You challenged &b%player argument% &7to a duel" to player
- send "&b%player% &7challenged you to a duel with type &b%arg-2%" to player argument
- send "&7Type &b/accept %player% &7to accept the duel" to player argument
- stop
- if {dueltype::%arg-2%} is not set:
- message "&7<bold>That duel type does not exist."
- command /accept <player>:
- permission: duel.accept
- permission message: &cYou don't have permission for that.
- trigger:
- if {PlayerInTeam::%player%} is set:
- message "&7You are in a team."
- stop
- if {PlayerInTeam::%player%} is not set:
- if {PlayerInTeam::%player argument%} is set:
- message "&7That player is in a team."
- stop
- if {PlayerInTeam::%player argument%} is not set:
- if {intour.%player%.true} is true:
- message "&7You cannot do that if you are in a tournament!"
- stop
- else:
- if {intour.%player argument%.true} is true:
- message "&7That player is in a tournament!"
- stop
- else:
- if {duel.%player argument%.ingame} is true:
- message "&b%player argument% is in a duel"
- stop
- if {duel.%player%.ingame} is false:
- if player argument is player:
- send "&7You cannot accept yourself" to player
- stop
- if player argument is not player:
- if {duel.%player%.req} is false:
- send "&7You do not have any pending requests" to player
- stop
- if {duel.%player%.req} is true:
- if {reqs.%player%::%player argument%} is not set:
- message "&b%player argument% &7hasn't sent you a duel request."
- stop
- if {reqs.%player%::%player argument%} is set:
- if size of {arenas::*} = 0: #thisline
- message "&7<bold>No arenas have been created."
- stop
- if size of {arenas::*} > 0:
- set {_used} to 0
- set {_ar} to size of {arenas::*}
- loop {arenas::*}:
- set {_arena} to loop-value
- set {_arenas::%{_arena}%} to {_arena}
- loop {_ar} times:
- set {option.%player%} to random element of {_arenas::*}
- if {arena.%{option.%player%}%.option} is false:
- send "&b%player% &7has accepted your duel request" to player argument
- send "&7You have accepted &b%player argument% &7duel" to player
- loop {reqs.%player%::%player argument%::*}:
- set {_type} to loop-value-2
- loop {dueltype::*}:
- remove player from {match.%loop-value-2%::*}
- remove player argument from {match.%loop-value-2%::*}
- set {duel.%player%.ingame} to true
- set {duel.%player argument%.ingame} to true
- add player to {duel.%player%::*}
- add player argument to {duel.%player%::*}
- add player argument to {duel.%player argument%::*}
- add player to {duel.%player argument%::*}
- add player to {stopbackup::*}
- add player argument to {stopbackup::*}
- set {_player1} to player
- set {_player2} to player argument
- clear {reqs.%{_player1}%::*}
- clear {reqs.%{_player2}%::*}
- set {arena.%{option.%player%}%.option} to true
- set {lastloc.%{_player1}%} to location of {_player1}
- set {lastloc.%{_player2}%} to location of {_player2}
- set {message.%{_player1}%} to true
- set {message.%{_player2}%} to true
- set {ender.%{_player1}%} to {@EC}
- set {ender.%{_player2}%} to {@EC}
- teleport {_player1} to {arena.%{option.%player%}%.spawn.1}
- teleport {_player2} to {arena.%{option.%player%}%.spawn.2}
- clear {_player1}'s inventory
- clear {_player2}'s inventory
- heal {_player1}
- heal {_player2}
- cure {_player1} from poison
- cure {_player2} from poison
- set {_player1}'s game mode to survival
- set {_player2}'s game mode to survival
- set {_effects.%{_player1}%::*} to all of the active potion effects on {_player1}
- loop {_effects.%{_player1}%::*}:
- remove loop-value-2 from {_player1}
- set {_effects.%{_player2}%::*} to all of the active potion effects on {_player2}
- loop {_effects.%{_player2}%::*}:
- remove loop-value-2 from {_player2}
- if {inv.%{_type}%::%{_player1}%} is set:
- set {_slload.%{_player1}%} to 0
- restore inventory of {_player1} from {custom.%{_type}%.%{_player1}%}
- equip {_player1} with {boots.%{_type}%.%{_player1}%}
- equip {_player1} with {chest.%{_type}%.%{_player1}%}
- equip {_player1} with {legs.%{_type}%.%{_player1}%}
- equip {_player1} with {helm.%{_type}%.%{_player1}%}
- clear {_slload.%{_player1}%}
- if {inv.%{_type}%::%{_player1}%} is not set:
- set {_slload.%{_player1}%} to 0
- restore inventory of {_player1} from {default.%{_type}%}
- equip {_player1} with {bootsdefault.%{_type}%}
- equip {_player1} with {chestdefault.%{_type}%}
- equip {_player1} with {legsdefault.%{_type}%}
- equip {_player1} with {helmdefault.%{_type}%}
- clear {_slload.%{_player1}%}
- if {inv.%{_type}%::%{_player2}%} is set:
- set {_slload.%{_player2}%} to 0
- restore inventory of {_player2} from {custom.%{_type}%.%{_player2}%}
- equip {_player2} with {boots.%{_type}%.%{_player2}%}
- equip {_player2} with {chest.%{_type}%.%{_player2}%}
- equip {_player2} with {legs.%{_type}%.%{_player2}%}
- equip {_player2} with {helm.%{_type}%.%{_player2}%}
- clear {_slload.%{_player2}%}
- if {inv.%{_type}%::%{_player2}%} is not set:
- set {_slload.%{_player2}%} to 0
- restore inventory of {_player2} from {default.%{_type}%}
- equip {_player2} with {bootsdefault.%{_type}%}
- equip {_player2} with {chestdefault.%{_type}%}
- equip {_player2} with {legsdefault.%{_type}%}
- equip {_player2} with {helmdefault.%{_type}%}
- clear {_slload.%{_player2}%}
- if {@S} > 0:
- set {_rn} to {@S}
- apply slowness tier 10 to {_player1} for {@S} seconds
- apply slowness tier 10 to {_player2} for {@S} seconds
- apply jump boost tier -10 to {_player1} for {@S} seconds
- apply jump boost tier -10 to {_player2} for {@S} seconds
- loop {_rn} times:
- message "&7<bold>Duel Starting in &b%{_rn}% &7<bold>seconds" to {_player1} and {_player2}
- send {_player1} title "&b%{_rn}%" with subtitle "&7To Start" for 1 seconds
- send {_player2} title "&b%{_rn}%" with subtitle "&7To Start" for 1 seconds
- remove 1 from {_rn}
- play "NOTE_PLING" specifically to {_player1} with pitch 5 and volume 1000
- play "NOTE_PLING" specifically to {_player2} with pitch 5 and volume 1000
- wait 1 second
- send {_player1} title "&bGo!" with subtitle "" for 1 seconds
- send {_player2} title "&bGo!" with subtitle "" for 1 seconds
- play "NOTE_PLING" specifically to {_player2} with pitch 1 and volume 1000
- remove slowness from {_player1}
- remove slowness from {_player2}
- remove jump boost from {_player1}
- remove jump boost from {_player2}
- delete {_rn}
- stop
- if {@S} <= 0:
- stop
- if {arena.%{option.%player%}%.option} is true:
- remove {option.%player%} from {_arenas::*}
- add 1 to {_used}
- if {_used} = {_ar}:
- message "&7All arenas are being used. Try later"
- command /match [<text>]:
- permission: duel.match
- permission message: &cYou don't have permission for that.
- trigger:
- if {PlayerInTeam::%player%} is set:
- message "&7You are in a team."
- stop
- if {PlayerInTeam::%player%} is not set:
- if {intour.%player%.true} is true:
- message "&7You cannot do that if you are in a tournament!"
- stop
- else:
- if {duel.%player%.ingame} is true:
- message "&7You are in a duel."
- if {duel.%player%.ingame} is false:
- if arg-1 is not set:
- set {_type.0} to 0
- set {_type.1} to 1
- set {_type.2} to 2
- set {_type.3} to 3
- set {_type.4} to 4
- set {_type.5} to 5
- set {_type.6} to 6
- set {_type.7} to 7
- set {_type.8} to 8
- open chest with 1 row named "{@T}" to player
- if {typeset::%{_type.0}%} is set:
- format slot {_type.0} of player with {slot.%{_type.0}%.item} named "&7<bold>%{slot.%{_type.0}%.name}%" to close then run [make player execute command "match %{slot.%{_type.0}%.name}%"]
- if {typeset::%{_type.0}%} is not set:
- format slot {_type.0} of player with air named "" to be unstealable
- if {typeset::%{_type.1}%} is set:
- format slot {_type.1} of player with {slot.%{_type.1}%.item} named "&7<bold>%{slot.%{_type.1}%.name}%" to close then run [make player execute command "match %{slot.%{_type.1}%.name}%"]
- if {typeset::%{_type.1}%} is not set:
- format slot {_type.1} of player with air named "" to be unstealable
- if {typeset::%{_type.2}%} is set:
- format slot {_type.2} of player with {slot.%{_type.2}%.item} named "&7<bold>%{slot.%{_type.2}%.name}%" to close then run [make player execute command "match %{slot.%{_type.2}%.name}%"]
- if {typeset::%{_type.2}%} is not set:
- format slot {_type.2} of player with air named "" to be unstealable
- if {typeset::%{_type.3}%} is set:
- format slot {_type.3} of player with {slot.%{_type.3}%.item} named "&7<bold>%{slot.%{_type.3}%.name}%" to close then run [make player execute command "match %{slot.%{_type.3}%.name}%"]
- if {typeset::%{_type.3}%} is not set:
- format slot {_type.3} of player with air named "" to be unstealable
- if {typeset::%{_type.4}%} is set:
- format slot {_type.4} of player with {slot.%{_type.4}%.item} named "&7<bold>%{slot.%{_type.4}%.name}%" to close then run [make player execute command "match %{slot.%{_type.4}%.name}%"]
- if {typeset::%{_type.4}%} is not set:
- format slot {_type.4} of player with air named "" to be unstealable
- if {typeset::%{_type.5}%} is set:
- format slot {_type.5} of player with {slot.%{_type.5}%.item} named "&7<bold>%{slot.%{_type.5}%.name}%" to close then run [make player execute command "match %{slot.%{_type.5}%.name}%"]
- if {typeset::%{_type.5}%} is not set:
- format slot {_type.5} of player with air named "" to be unstealable
- if {typeset::%{_type.6}%} is set:
- format slot {_type.6} of player with {slot.%{_type.6}%.item} named "&7<bold>%{slot.%{_type.6}%.name}%" to close then run [make player execute command "match %{slot.%{_type.6}%.name}%"]
- if {typeset::%{_type.6}%} is not set:
- format slot {_type.6} of player with air named "" to be unstealable
- if {typeset::%{_type.7}%} is set:
- format slot {_type.7} of player with {slot.%{_type.7}%.item} named "&7<bold>%{slot.%{_type.7}%.name}%" to close then run [make player execute command "match %{slot.%{_type.7}%.name}%"]
- if {typeset::%{_type.7}%} is not set:
- format slot {_type.7} of player with air named "" to be unstealable
- if {typeset::%{_type.8}%} is set:
- format slot {_type.8} of player with {slot.%{_type.8}%.item} named "&7<bold>%{slot.%{_type.8}%.name}%" to close then run [make player execute command "match %{slot.%{_type.8}%.name}%"]
- if {typeset::%{_type.8}%} is not set:
- format slot {_type.8} of player with air named "" to be unstealable
- if arg-1 is set:
- set {_type} to arg-1
- if command sender is a player:
- if {queue.%player%} is true:
- message "&7You are currently in a queue."
- message "&7Type &b/leave &7to leave the queue."
- stop
- if {queue.%player%} is false:
- add player to {match.%{_type}%::*}
- wait 0.2 ticks
- set {_size} to size of {match.%{_type}%::*}
- if {_size} = 1:
- set {queue.%player%} to true
- message "&7You have been added to the &b%{_type}% &7queue." to player
- set slot 0 of player to {@Q} named "{@QN}"
- stop
- if {_size} = 2:
- if size of {arenas::*} = 0:
- message "&7<bold>No arenas have been created."
- stop
- if size of {arenas::*} > 0:
- if {_size} = 2:
- set {_used} to 0
- set {_ar} to size of {arenas::*}
- loop {arenas::*}:
- set {_arena} to loop-value
- set {_arenas::%{_arena}%} to {_arena}
- loop {_ar} times:
- set {option.%player%} to random element of {_arenas::*}
- if {arena.%{option.%player%}%.option} is false:
- if {_size} = 2:
- send "&7You have been added to the &b%{_type}% &7queue." to player
- set {_player1} to random element of {match.%{_type}%::*}
- remove {_player1} from {match.%{_type}%::*}
- set {_player2} to random element of {match.%{_type}%::*}
- remove {_player2} from {match.%{_type}%::*}
- if {_player1} is not a player:
- stop
- if {_player1} is a player:
- if {_player2} is not a player:
- stop
- if {_player2} is a player:
- send "&7You are in a match against &b%{_player2}%" to {_player1}
- send "&7You are in a match against &b%{_player1}%" to {_player2}
- set {queue.%{_player1}%} to false
- set {queue.%{_player2}%} to false
- clear {match.%{_type}%::*}
- set {duel.%{_player1}%.ingame} to true
- set {duel.%{_player2}%.ingame} to true
- add {_player1} to {duel.%{_player1}%::*}
- add {_player2} to {duel.%{_player1}%::*}
- add {_player2} to {duel.%{_player2}%::*}
- add {_player1} to {duel.%{_player2}%::*}
- add {_player1} to {stopbackup::*}
- add {_player2} to {stopbackup::*}
- clear {reqs.%{_player1}%::*}
- clear {reqs.%{_player2}%::*}
- set {arena.%{option.%player%}%.option} to true
- set {lastloc.%{_player1}%} to location of {_player1}
- set {lastloc.%{_player2}%} to location of {_player2}
- set {message.%{_player1}%} to true
- set {message.%{_player2}%} to true
- set {ender.%{_player1}%} to {@EC}
- set {ender.%{_player2}%} to {@EC}
- teleport {_player1} to {arena.%{option.%player%}%.spawn.1}
- teleport {_player2} to {arena.%{option.%player%}%.spawn.2}
- clear {_player1}'s inventory
- clear {_player2}'s inventory
- heal {_player1}
- heal {_player2}
- cure {_player1} from poison
- cure {_player2} from poison
- set {_player1}'s game mode to survival
- set {_player2}'s game mode to survival
- set {_effects.%{_player1}%::*} to all of the active potion effects on {_player1}
- loop {_effects.%{_player1}%::*}:
- remove loop-value-2 from {_player1}
- set {_effects.%{_player2}%::*} to all of the active potion effects on {_player2}
- loop {_effects.%{_player2}%::*}:
- remove loop-value-2 from {_player2}
- if {inv.%{_type}%::%{_player1}%} is set:
- set {_slload.%{_player1}%} to 0
- restore inventory of {_player1} from {custom.%{_type}%.%{_player1}%}
- equip {_player1} with {boots.%{_type}%.%{_player1}%}
- equip {_player1} with {chest.%{_type}%.%{_player1}%}
- equip {_player1} with {legs.%{_type}%.%{_player1}%}
- equip {_player1} with {helm.%{_type}%.%{_player1}%}
- clear {_slload.%{_player1}%}
- if {inv.%{_type}%::%{_player1}%} is not set:
- set {_slload.%{_player1}%} to 0
- restore inventory of {_player1} from {default.%{_type}%}
- equip {_player1} with {bootsdefault.%{_type}%}
- equip {_player1} with {chestdefault.%{_type}%}
- equip {_player1} with {legsdefault.%{_type}%}
- equip {_player1} with {helmdefault.%{_type}%}
- clear {_slload.%{_player1}%}
- if {inv.%{_type}%::%{_player2}%} is set:
- set {_slload.%{_player2}%} to 0
- restore inventory of {_player2} from {custom.%{_type}%.%{_player2}%}
- equip {_player2} with {boots.%{_type}%.%{_player2}%}
- equip {_player2} with {chest.%{_type}%.%{_player2}%}
- equip {_player2} with {legs.%{_type}%.%{_player2}%}
- equip {_player2} with {helm.%{_type}%.%{_player2}%}
- clear {_slload.%{_player2}%}
- if {inv.%{_type}%::%{_player2}%} is not set:
- set {_slload.%{_player2}%} to 0
- restore inventory of {_player2} from {default.%{_type}%}
- equip {_player2} with {bootsdefault.%{_type}%}
- equip {_player2} with {chestdefault.%{_type}%}
- equip {_player2} with {legsdefault.%{_type}%}
- equip {_player2} with {helmdefault.%{_type}%}
- clear {_slload.%{_player2}%}
- if {@S} > 0:
- set {_rn} to {@S}
- apply slowness tier 10 to {_player1} for {@S} seconds
- apply slowness tier 10 to {_player2} for {@S} seconds
- apply jump boost tier -10 to {_player1} for {@S} seconds
- apply jump boost tier -10 to {_player2} for {@S} seconds
- loop {_rn} times:
- message "&7<bold>Duel Starting in &b%{_rn}% &7<bold>seconds" to {_player1} and {_player2}
- play "NOTE_PLING" specifically to {_player1} with pitch 5 and volume 1000
- play "NOTE_PLING" specifically to {_player2} with pitch 5 and volume 1000
- send {_player1} title "&b%{_rn}%" with subtitle "&7To Start" for 1 seconds
- send {_player2} title "&b%{_rn}%" with subtitle "&7To Start" for 1 seconds
- remove 1 from {_rn}
- wait 1 second
- send {_player1} title "&bGo!" with subtitle "" for 1 seconds
- send {_player2} title "&bGo!" with subtitle "" for 1 seconds
- play "NOTE_PLING" specifically to {_player2} with pitch 1 and volume 1000
- remove slowness from {_player1}
- remove slowness from {_player2}
- remove jump boost from {_player1}
- remove jump boost from {_player2}
- delete {_rn}
- stop
- if {@S} <= 0:
- stop
- if {arena.%{option.%player%}%.option} is true:
- remove {option.%player%} from {_arenas::*}
- add 1 to {_used}
- if {_used} = {_ar}:
- message "&7All arenas are being used. Try later"
- if {_size} = 1:
- set {queue.%player%} to true
- message "&7You have been added to the &b%{_type}% &7queue." to player
- set slot 0 of player to {@Q} named "{@QN}"
- stop
- command /matchstatus:
- permission: duel.match.status
- permission message: &cYou don't have permission for that.
- trigger:
- loop {dueltype::*}:
- loop {match.%loop-value-1%::*}:
- message "%loop-value-1% - %loop-value-2%"
- command /leave:
- permission: duel.leave
- permission message: &cYou don't have permission for that.
- trigger:
- if {queue.%player%} is true:
- set {queue.%player%} to false
- loop {dueltype::*}:
- remove player from {match.%loop-value%::*}
- message "&7You left the queue."
- set slot 0 of player to air
- stop
- if {queue.%player%} is false:
- message "&7You are not in a queue."
- stop
- on right click:
- if player's tool is {@Q}:
- if name of player's tool is "{@QN}":
- make player execute command "/leave"
- on death of a player:
- if {duel.%player%.ingame} is true:
- set {respawn.lobby} to true
- set the death message to ""
- set {_looser} to player
- loop {duel.%{_looser}%::*}:
- remove {_looser} from {duel.%{_looser}%::*}
- wait 1 tick
- loop {duel.%{_looser}%::*}:
- set {_winnerd} to loop-value
- set {duel.%{_looser}%.ingame} to true
- set {duel.%{_looser}%.req} to true
- set {duel.%{_winnerd}%.ingame} to true
- set {duel.%{_winnerd}%.req} to true
- set {after.%{_winnerd}%} to true
- if {message.%{_winnerd}%} is true:
- broadcast "&b%{_winnerd}%&7 defeated &b%{_looser}%&7 in a duel"
- set {message.%{_winnerd}%} to false
- set {message.%{_looser}%} to false
- wait 5 seconds
- delete {ender.%{_winnerd}%}
- delete {ender.%{_looser}%}
- set {_effects.%{_winnerd}%::*} to all of the active potion effects on {_winnerd}
- loop {_effects.%{_winnerd}%::*}:
- remove loop-value from {_winnerd}
- set {_effects.%{_looser}%::*} to all of the active potion effects on {_looser}
- loop {_effects.%{_looser}%::*}:
- remove loop-value from {_looser}
- if {_winnerd} is dead:
- force respawn {_winnerd}
- if {_looser} is dead:
- force respawn {_looser}
- set {respawn.lobby} to false
- heal {_winnerd}
- heal {_looser}
- cure {_winnerd} from poison
- cure {_looser} from poison
- clear {_winnerd}'s inventory
- clear {_looser}'s inventory
- set {duel.%{_looser}%.ingame} to false
- set {duel.%{_looser}%.req} to false
- set {duel.%{_winnerd}%.ingame} to false
- set {duel.%{_winnerd}%.req} to false
- set {message.%{_winnerd}%} to true
- remove {_winnerd} from {stopbackup::*}
- remove {_looser} from {stopbackup::*}
- clear {duel.%{_winnerd}%::*}
- clear {duel.%{_looser}%::*}
- set {after.%{_winnerd}%} to false
- set {arena.%{option.%{_winnerd}%}%.option} to false
- set {arena.%{option.%{_looser}%}%.option} to false
- if {lobby.arena} is set:
- teleport {_winnerd} to {lobby.arena}
- teleport {_looser} to {lobby.arena}
- if {lobby.arena} is not set:
- teleport {_winnerd} to {lastloc.%{_winnerd}%}
- teleport {_looser} to {lastloc.%{_looser}%}
- wait 1 tick
- clear {lastloc.%{_winnerd}%}
- clear {lastloc.%{_looser}%}
- stop
- on quit:
- if {duel.%player%.ingame} is true:
- set {_looser} to player
- loop {duel.%{_looser}%::*}:
- remove {_looser} from {duel.%{_looser}%::*}
- wait 1 tick
- loop {duel.%{_looser}%::*}:
- set {_winnerd} to loop-value
- set {duel.%{_looser}%.ingame} to true
- set {duel.%{_looser}%.req} to true
- set {duel.%{_winnerd}%.ingame} to true
- set {duel.%{_winnerd}%.req} to true
- set {after.%{_winnerd}%} to true
- if {message.%{_winnerd}%} is true:
- broadcast "&b%{_winnerd}%&7 defeated &b%{_looser}%&7 in a duel for logging out."
- set {message.%{_winnerd}%} to false
- set {message.%{_looser}%} to false
- wait 1 tick
- set {quit.%{_looser}%} to true
- wait 5 seconds
- delete {ender.%{_winnerd}%}
- delete {ender.%{_looser}%}
- set {_effects.%{_winnerd}%::*} to all of the active potion effects on {_winnerd}
- loop {_effects.%{_winnerd}%::*}:
- remove loop-value from {_winnerd}
- if {_winnerd} is dead:
- force respawn {_winnerd}
- if {_looser} is dead:
- force respawn {_looser}
- heal {_winnerd}
- clear {_winnerd}'s inventory
- clear {_looser}'s inventory
- set {duel.%{_looser}%.ingame} to false
- set {duel.%{_looser}%.req} to false
- set {duel.%{_winnerd}%.ingame} to false
- set {duel.%{_winnerd}%.req} to false
- remove {_winnerd} from {stopbackup::*}
- remove {_looser} from {stopbackup::*}
- clear {duel.%{_winnerd}%::*}
- clear {duel.%{_looser}%::*}
- set {after.%{_winnerd}%} to false
- set {arena.%{option.%{_winnerd}%}%.option} to false
- set {arena.%{option.%{_looser}%}%.option} to false
- if {lobby.arena} is set:
- teleport {_winnerd} to {lobby.arena}
- teleport {_looser} to {lobby.arena}
- if {lobby.arena} is not set:
- teleport {_winnerd} to {lastloc.%{_winnerd}%}
- clear {lastloc.%{_winnerd}%}
- if {queue.%player%} is true:
- set {queue.%player%} to false
- loop {dueltype::*}:
- remove player from {match.%loop-value%::*}
- on respawn:
- clear player's inventory
- if {respawn.lobby} is true:
- if {lobby.arena} is set:
- teleport player to {lobby.arena}
- if {lobby.arena} is not set:
- teleport player to {lastloc.%player%}
- clear {lastloc.%player%}
- command /createarena <text>:
- permission: duel.arena.create
- permission message: &cYou don't have permission for that.
- usage: &7/createarena &b<arena>
- trigger:
- if {arenas::%arg 1%} is set:
- message "&7<bold>Arena already exists"
- else:
- set {arenas::%arg 1%} to arg 1
- message "&7<bold>Arena &b%arg 1% &7<bold>Created!"
- set {arena.%arg-1%.option} to false
- command /setspawnpoint <text> <integer>:
- permission: duel.arena.spawn
- permission message: &cYou don't have permission for that.
- usage: &7/setspawnpoint &b<arena> <player>
- trigger:
- if {arenas::%arg 1%} is set:
- if arg-2 = 1:
- set {arena.%arg 1%.spawn.1} to location of player
- send "&7<bold>Arena &b<bold>%arg 1% &7<bold>First spawn set to %location of player%" to player
- if arg-2 = 2:
- set {arena.%arg 1%.spawn.2} to location of player
- send "&7<bold>Arena &b<bold>%arg 1% &7<bold>Second spawn set to %location of player%" to player
- if arg-2 > 2:
- send "&7<bold>Invalid Spawnpoint."
- if arg-2 < 1:
- send "&7<bold>Invalid Spawnpoint."
- else:
- send "&7<bold>Arena &b<bold>%arg 1% &7<bold>doesn't exist" to player
- command /lobbyarena:
- permission: duel.lobby.set
- permission message: &cYou don't have permission for that.
- trigger:
- set {lobby.arena} to location of player
- message "&7<bold>Lobby was successfully created."
- stop
- command /lobbyclear:
- permission: duel.lobby.clear
- permission message: &cYou don't have permission for that.
- trigger:
- if {lobby.arena} is set:
- delete {lobby.arena}
- message "&7<bold>Lobby was deleted"
- stop
- if {lobby.arena} is not set:
- message "&7<bold>You have not set a lobby yet."
- stop
- command /cleararena <text>:
- permission: duel.arena.clear
- permission message: &cYou don't have permission for that.
- usage: &7/cleararena &b<arena>
- trigger:
- if size of {arenas::*} > 0:
- loop {arenas::*}:
- if {arenas::%arg-1%} is set:
- delete {arenas::%arg 1%}
- remove arg 1 from {arenas::*}
- clear {arena.%arg 1%.spawn.1}
- clear {arena.%arg 1%.spawn.2}
- send "&7<bold>Arena &b<bold>%arg 1% &7<bold>cleared" to player
- stop
- else:
- send "&7<bold>Arena &b<bold>%arg 1% &7<bold>doesn't exist" to player
- stop
- else:
- message "&7<bold>You haven't created any arenas" to player
- command /clearall:
- permission: duel.arena.clearall
- permission message: &cYou don't have permission for that.
- trigger:
- if size of {arenas::*} > 0:
- loop {arenas::*}:
- delete {arenas::%loop-value%}
- delete {arena.%loop-value%.spawn.1}
- delete {arena.%loop-value%.spawn.2}
- message "&7<bold>All arenas have been cleared"
- else:
- message "&7<bold>You haven't set any arenas"
- command /listarena:
- permission: duel.arena.list
- permission message: &cYou don't have permission for that.
- trigger:
- if size of {arenas::*} = 0:
- message "&7<bold>You haven't created any arenas."
- if size of {arenas::*} > 0:
- loop {arenas::*}:
- message "&7<bold>Arena - &b%loop-value%"
- command /tparena <text> <integer>:
- permission: duel.arena.tp
- permission message: &cYou don't have permission for that.
- usage: &7/tparena &b<arena> <player>
- trigger:
- if {arenas::%arg 1%} is set:
- if arg-2 = 1:
- if {arena.%arg 1%.spawn.1} is not set:
- message "&7<bold>That spawn has not been set."
- if {arena.%arg 1%.spawn.1} is set:
- teleport player to {arena.%arg 1%.spawn.1}
- send "&7<bold>You have been teleported to &b<bold>Arena %arg 1% &7<bold>to &b<bold>Player %arg 2% &7<bold>spawn" to player
- if arg-2 = 2:
- if {arena.%arg 1%.spawn.2} is not set:
- message "&7<bold>That spawn has not been set."
- if {arena.%arg 1%.spawn.2} is set:
- teleport player to {arena.%arg 1%.spawn.2}
- send "&7<bold>You have been teleported to &b<bold>Arena %arg 1% &7<bold>to &7<bold>bPlayer %arg 2% &7<bold>spawn" to player
- else:
- send "&7<bold>Arena &b<bold>%arg 1% &7<bold>doesn't exist" to player
- command /custominv <text> <text> [<player>]:
- trigger:
- if arg-1 is "save":
- if arg-3 is set:
- if arg-3 is not player:
- if player has permission "duel.inv.save":
- if {dueltype::%arg-2%} is set:
- if arg-3 can't hold 36 wooden swords:
- delete {inv.%arg-2%::%arg-3%}
- set {inv.%arg-2%::%arg-3%} to arg-3
- clear {custom.%arg-2%.%arg-3%}
- set {custom.%arg-2%.%arg-3%} to arg-3's serialized inventory
- set {helm.%arg-2%.%arg-3%} to helmet of arg-3
- set {chest.%arg-2%.%arg-3%} to chestplate of arg-3
- set {legs.%arg-2%.%arg-3%} to leggings of arg-3
- set {boots.%arg-2%.%arg-3%} to boots of arg-3
- clear arg-3's helmet
- clear arg-3's chestplate
- clear arg-3's leggings
- clear arg-3's boots
- equip player argument with {helm.%arg-2%.%arg-3%}
- equip player argument with {chest.%arg-2%.%arg-3%}
- equip player argument with {legs.%arg-2%.%arg-3%}
- equip player argument with {boots.%arg-2%.%arg-3%}
- message "&7<bold>Inventory succesfully saved." to arg-3
- stop
- if arg-3 can hold 36 wooden swords:
- message "&7<bold>You cannot save the inventory if it is empty"
- stop
- if {dueltype::%arg-1%} is not set:
- message "&7<bold>You first need to create that duel type."
- stop
- else:
- message "&cYou don't have permission for that."
- stop
- if arg-3 is player:
- if {dueltype::%arg-2%} is set:
- arg-3 can't hold 36 wooden swords:
- delete {inv.%arg-2%::%arg-3%}
- set {inv.%arg-2%::%arg-3%} to arg-3
- clear {custom.%arg-2%.%arg-3%}
- set {custom.%arg-2%.%arg-3%} to arg-3's serialized inventory
- set {helm.%arg-2%.%arg-3%} to helmet of arg-3
- set {chest.%arg-2%.%arg-3%} to chestplate of arg-3
- set {legs.%arg-2%.%arg-3%} to leggings of arg-3
- set {boots.%arg-2%.%arg-3%} to boots of arg-3
- clear arg-3's helmet
- clear arg-3's chestplate
- clear arg-3's leggings
- clear arg-3's boots
- equip player argument with {helm.%arg-2%.%arg-3%}
- equip player argument with {chest.%arg-2%.%arg-3%}
- equip player argument with {legs.%arg-2%.%arg-3%}
- equip player argument with {boots.%arg-2%.%arg-3%}
- message "&7<bold>Inventory succesfully saved." to arg-3
- stop
- if arg-3 can hold 36 wooden swords:
- message "&7<bold>You cannot save the inventory if it is empty"
- stop
- if {dueltype::%arg-2%} is not set:
- message "&7<bold>You first need to create that duel type."
- stop
- if arg-3 is not set:
- make player execute command "/custominv save %arg-2% %player%"
- stop
- if arg-1 is "delete":
- if arg-3 is set:
- if arg-3 is not player:
- if player has permission "duel.inv.delete":
- if {dueltype::%arg-2%} is set:
- delete {inv.%arg-2%::%arg-3%}
- delete {custom.%arg-2%.%arg-3%}
- delete {helm.%arg-2%.%arg-3%}
- delete {chest.%arg-2%.%arg-3%}
- delete {legs.%arg-2%.%arg-3%}
- delete {boots.%arg-2%.%arg-3%}
- message "&7<bold>Current Inventory of %arg-3% Succesfully Deleted" to arg-3
- stop
- if {dueltype::%arg-2%} is not set:
- message "&7<bold>You first need to create that duel type."
- stop
- else:
- message "&cYou don't have permission for that."
- stop
- if arg-3 is player:
- if {dueltype::%arg-2%} is set:
- delete {inv.%arg-2%::%arg-3%}
- delete {custom.%arg-2%.%arg-3%}
- delete {helm.%arg-2%.%arg-3%}
- delete {chest.%arg-2%.%arg-3%}
- delete {legs.%arg-2%.%arg-3%}
- delete {boots.%arg-2%.%arg-3%}
- message "&7<bold>Current Inventory of %arg-3% Succesfully Deleted" to arg-3
- stop
- if {dueltype::%arg-2%} is not set:
- message "&7<bold>You first need to create that duel type."
- stop
- if arg-3 is not set:
- make player execute command "/custominv delete %arg-2% %player%"
- stop
- if arg-1 is "load":
- if arg-3 is set:
- if arg-3 is not player:
- if player has permission "duel.inv.load":
- if {dueltype::%arg-2%} is set:
- set {_type} to arg-2
- restore inventory of arg-3 from {custom.%arg-2%.%arg-3%}
- equip arg-3 with {boots.%{_type}%.%arg-3%}
- equip arg-3 with {chest.%{_type}%.%arg-3%}
- equip arg-3 with {legs.%{_type}%.%arg-3%}
- equip arg-3 with {helm.%{_type}%.%arg-3%}
- stop
- if {dueltype::%arg-2%} is not set:
- message "&7<bold>You first need to create that duel type."
- stop
- else:
- message "&cYou don't have permission for that."
- if arg-3 is player:
- if {dueltype::%arg-2%} is set:
- set {_type} to arg-2
- restore inventory of arg-3 from {custom.%arg-2%.%arg-3%}
- equip arg-3 with {boots.%{_type}%.%arg-3%}
- equip arg-3 with {chest.%{_type}%.%arg-3%}
- equip arg-3 with {legs.%{_type}%.%arg-3%}
- equip arg-3 with {helm.%{_type}%.%arg-3%}
- stop
- if {dueltype::%arg-2%} is not set:
- message "&7<bold>You first need to create that duel type."
- stop
- if arg-3 is not set:
- make player execute command "/custominv load %arg-2% %player%"
- stop
- command /defaultinv <text> <text>:
- permission: duel.inv.default
- permission message: &cYou don't have permission for that.
- trigger:
- if arg-1 is "save":
- if {dueltype::%arg-2%} is set:
- player can't hold 36 wooden swords:
- clear {default.%arg-2%}
- set {default.%arg-2%} to player's serialized inventory
- set {helmdefault.%arg-2%} to helmet of the player
- set {chestdefault.%arg-2%} to chestplate of the player
- set {legsdefault.%arg-2%} to leggings of the player
- set {bootsdefault.%arg-2%} to boots of the player
- clear player's helmet
- clear player's chestplate
- clear player's leggings
- clear player's boots
- equip player with {helmdefault.%arg-2%}
- equip player with {chestdefault.%arg-2%}
- equip player with {legsdefault.%arg-2%}
- equip player with {bootsdefault.%arg-2%}
- message "&7<bold>Default inventory succesfully saved."
- player can hold 36 wooden swords:
- message "&7<bold>You cannot save your inventory if it is empty"
- stop
- if {dueltype::%arg-2%} is not set:
- message "&7<bold>You first need to create that duel type."
- stop
- if arg-1 is "load":
- if {dueltype::%arg-2%} is set:
- set {_type} to arg-2
- restore inventory of player from {default.%{_type}%}
- equip player with {bootsdefault.%{_type}%}
- equip player with {chestdefault.%{_type}%}
- equip player with {legsdefault.%{_type}%}
- equip player with {helmdefault.%{_type}%}
- stop
- if {dueltype::%arg-2%} is not set:
- message "&7<bold>You first need to create that duel type."
- stop
- if arg-1 is "delete":
- if {dueltype::%arg-2%} is set:
- delete {default.%arg-2%}
- delete {helmdefault.%arg-2%}
- delete {chestdefault.%arg-2%}
- delete {legsdefault.%arg-2%}
- delete {bootsdefault.%arg-2%}
- message "&7<bold>Current Default Inventory Succesfully Deleted"
- stop
- if {dueltype::%arg-1%} is not set:
- message "&7<bold>You first need to create that duel type."
- stop
- on join:
- if {quit.%player%} is true:
- set {_effects.%player%::*} to all of the active potion effects on player
- loop {_effects.%player%::*}:
- remove loop-value from player
- clear player's inventory
- heal player
- if {lobby.arena} is set:
- teleport player to {lobby.arena}
- if {lobby.arena} is not set:
- teleport player to {lastloc.%player%}
- clear {lastloc.%player%}
- set {quit.%player%} to false
- if {backup.%player%} is true:
- clear player's inventory
- set {backup.%player%} to false
- if {lobby.arena} is set:
- teleport player to {lobby.arena}
- if {lobby.arena} is not set:
- teleport player to {lastloc.%player%}
- set {duel.%player%.ingame} to false
- set {duel.%player%.req} to false
- set {after.%player%} to false
- clear {reqs.%player%::*}
- set {queue.%player%} to false
- stop
- on skript stop:
- if size of {arenas::*} > 0:
- set {list::*} to {arenas::*}
- loop {list::*}:
- set {_onstop} to size of {arenas::*}
- loop {_onstop} times:
- set {_onstopa} to random element of {list::*}
- set {arena.%{_onstopa}%.option} to false
- remove {_onstopa} from {list::*}
- delete {list::*}
- loop {stopbackup::*}:
- set {_nump} to size of {stopbackup::*}
- loop {_nump} times:
- set {_playerstop} to random element of {stopbackup::*}
- set {backup.%{_playerstop}%} to true
- remove {_playerstop} from {stopbackup::*}
- delete {stopbackup::*}
- loop {dueltype::*}:
- clear {match.%loop-value%::*}
- stop
- on skript start:
- loop {dueltype::*}:
- clear {match.%loop-value%::*}
- stop
- on shoot:
- if {duel.%shooter%.ingame} is true:
- if {ender.%shooter%} is true:
- shooter is a player:
- if projectile is an ender pearl:
- set {_difference} to difference between {pearl.%shooter%.lastused} and now
- if {_difference} is less than {@ECT} seconds:
- cancel event
- give 1 ender pearl with lore "&cKit" to shooter
- set {_difference} to difference between {_difference} and {@ECT} seconds
- message "&b%{_difference}% &7<bold>seconds left" to shooter
- stop
- set {pearl.%shooter%.lastused} to now
- command /dueltype <text>:
- permission: duel.type
- permission message: &cYou don't have permission for that.
- trigger:
- if {dueltype::%arg-1%} is set:
- message "&b%arg-1% &7<bold>duel type has already been set."
- stop
- if {dueltype::%arg-1%} is not set:
- set {dueltype::%arg-1%} to arg-1
- message "&7<bold>You set &b%arg-1% &7<bold>duel type."
- command /dueltypeinv <text> <integer> <item>:
- permission: duel.type.inv
- permission message: &cYou don't have permission for that.
- trigger:
- if {dueltype::%arg-1%} is set:
- if arg-2 <= 8:
- set {_slot} to arg-2
- clear {slot.%{_slot}%.name}
- clear {slot.%{_slot}%.item}
- loop {duel.%arg-1%::*}:
- set {_slotdelinv} to loop-value
- delete {typeset::%{_slotdelinv}%}
- clear {slot.%{_slotdelinv}%.item}
- clear {slot.%{_slotdelinv}%.name}
- wait 1 tick
- set {slot.%{_slot}%.name} to arg-1
- set {slot.%{_slot}%.item} to arg-3
- set {typeset::%arg-2%} to arg-2
- clear {duel.%arg-1%::*}
- wait 1 tick
- add arg-2 to {duel.%arg-1%::*}
- message "&7<bold>Item &b%arg-3% &7<bold>will be displayed in slot &b%{_slot}% &7<bold>for &b%arg-1% &7<bold>duel type."
- if arg-2 > 8:
- message "&7<bold>Invalid Slot"
- if {dueltype::%arg-1%} is not set:
- message "&7<bold>You first need to create that duel type."
- command /dueltypedel <text>:
- permission: duel.type.del
- permission message: &cYou don't have permission for that.
- trigger:
- if {dueltype::%arg-1%} is set:
- delete {dueltype::%arg-1%}
- message "&b%arg-1% &7<bold>duel type deleted."
- set {_slotdel} to 0
- loop 36 times:
- delete {slot.%{_slotdel}%.%arg-1%}
- add 1 to {_slotdel}
- clear {_slotdel}
- loop {inv.%arg-1%::*}:
- delete {custom.%arg-1%.%loop-value%}
- delete {helm.%arg-1%.%loop-value%}
- delete {chest.%arg-1%.%loop-value%}
- delete {legs.%arg-1%.%loop-value%}
- delete {boots.%arg-1%.%loop-value%}
- delete {inv::*}
- loop {duel.%arg-1%::*}:
- set {_slotdelinv} to loop-value
- delete {typeset::%{_slotdelinv}%}
- clear {slot.%{_slotdelinv}%.item}
- clear {slot.%{_slotdelinv}%.name}
- stop
- if {dueltype::%arg-1%} is not set:
- message "&7<bold>You first need to create that duel type."
- stop
- command /dueltypelist:
- permission: duel.type.list
- permission message: &cYou don't have permission for that.
- trigger:
- loop {dueltype::*}:
- message "&7Duel Type - %loop-value%"
- command /clearslot <integer>:
- permission: duel.type.slot
- permission message: &cYou don't have permission for that.
- trigger:
- delete {typeset::%arg-1%}
- clear {slot.%arg-1%.item}
- clear {slot.%arg-1%.name}
- on right click with a {@I}:
- if name of player's tool is "{@IN}":
- wait 1 tick
- make player execute command "/match"
- stop
- command /matchitem:
- permission: duel.match.item
- permission message: &cYou don't have permission for that.
- trigger:
- give player 1 {@I} named "{@IN}"
- stop
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement