Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- options:
- P: &8[&2Duels&8]&r
- command /resetduels:
- permission: skript.op
- trigger:
- delete {queue::*}
- delete {arenas::*}
- delete {isDueling::*}
- wait 1 tick
- add "arena1" to {arenas::*}
- add "arena2" to {arenas::*}
- add "arena3" to {arenas::*}
- add "arena4" to {arenas::*}
- add "arena5" to {arenas::*}
- add "arena6" to {arenas::*}
- add "arena7" to {arenas::*}
- add "arena8" to {arenas::*}
- add "arena9" to {arenas::*}
- message "{@P} Duels have been reset!"
- command /listarenas:
- permission: skript.op
- trigger:
- message "{@P} %{arenas::*}%"
- command /duel:
- trigger:
- set {_p1} to the command sender
- if {queue::*} contains {_p1}:
- message "{@P} You are already in the queue!"
- stop trigger
- if {isDueling::*} contains {_p1}:
- message "{@P} You are already in a duel!"
- stop trigger
- if command sender is in "pvparena":
- message "{@P} You can't join the duels queue while in the arena!"
- stop trigger
- if (size of {queue::*}) is less than 1:
- message "{@P} Added to the duels queue!"
- add {_p1} to {queue::*}
- wait 2 seconds
- message "{@P} The queue is empty! Waiting for someone to join..."
- stop trigger
- else:
- # Other Stuff
- remove {_p1} from {isDueling::*}
- add {_p1} to {queue::*}
- message "{@P} Added to the duels queue!"
- wait 2 seconds
- # Picks an opponent
- set {_p2} to a random element of {queue::*}
- while {_p2} is equal to {_p1}:
- set {_p2} to a random element of {queue::*}
- remove {_p2} from {queue::*}
- remove {_p1} from {queue::*}
- # Picks a random arena
- delete {arena.%{_p1}%}
- delete {arena.%{_p2}%}
- set {arena.%{_p1}%} to a random element of {arenas::*}
- remove {arena.%{_p1}%} from {arenas::*}
- if {arenas::*} is empty:
- message "{@P} All the duel arenas are full! Try again another time!" to {_p1} and {_p2}
- stop trigger
- # Initiates the duel
- send "{@P} Your duel with &a%{_p1}% &fwill start in 3..." to {_p2}
- send "{@P} Your duel with &a%{_p2}% &fwill start in 3..." to {_p1}
- command "/playsound random.orb %{_p1}% ~ ~ ~ 5 5 5"
- command "/playsound random.orb %{_p2}% ~ ~ ~ 5 5 5"
- wait 1 second
- send "{@P} Your duel with &a%{_p1}% &fwill start in 2..." to {_p2}
- send "{@P} Your duel with &a%{_p2}% &fwill start in 2..." to {_p1}
- command "/playsound random.orb %{_p1}% ~ ~ ~ 5 5 5"
- command "/playsound random.orb %{_p2}% ~ ~ ~ 5 5 5"
- wait 1 second
- send "{@P} Your duel with &a%{_p1}% &fwill start in 1..." to {_p2}
- send "{@P} Your duel with &a%{_p2}% &fwill start in 1..." to {_p1}
- command "/playsound random.orb %{_p1}% ~ ~ ~ 5 5 5"
- command "/playsound random.orb %{_p2}% ~ ~ ~ 5 5 5"
- wait 1 second
- command "/warp %{arena.%{_p1}%}%:1 %{_p1}%"
- command "/warp %{arena.%{_p1}%}%:2 %{_p2}%"
- send "{@P} You are now dueling with &a%{_p1}%" to {_p2}
- send "{@P} You are now dueling with &a%{_p2}%" to {_p1}
- command "/playsound mob.wither.spawn %{_p1}% ~ ~ ~ 4 4 4"
- command "/playsound mob.wither.spawn %{_p2}% ~ ~ ~ 4 4 4"
- remove {_p1} from {queue::*}
- remove {_p2} from {queue::*}
- add {_p1} to {isDueling::*}
- add {_p2} to {isDueling::*}
- # Give items to the player
- clear the inventory of {_p1} and {_p2}
- give an iron sword to {_p1}
- give an iron sword to {_p2}
- give a bow of infinity 1 to {_p1}
- give a bow of infinity 1 to {_p2}
- give 2 golden apples to {_p1}
- give 2 golden apples to {_p2}
- give an arrow to {_p1}
- give an arrow to {_p2}
- set helmet of {_p1} and {_p2} to iron helmet
- set chestplate of {_p1} and {_p2} to iron chestplate
- set leggings of {_p1} and {_p2} to iron leggings
- set boots of {_p1} and {_p2} to iron boots
- on death of player:
- victim and attacker are in "spawn":
- damage was caused by attack or projectile:
- add {arena.%victim%} to {arenas::*}
- add {arena.%attacker%} to {arenas::*}
- remove the attacker and the victim from {isDueling::*}
- wait 3 ticks
- clear the inventory of the victim and the attacker
- command "/spawn %attacker%"
- message "{@P} You won the duel against %victim%!" to the attacker
- message "{@P} You lost the duel agains %attacker%!" to the victim
- command "/playsound random.orb %victim% ~ ~ ~ 5 5 5"
- command "/playsound random.orb %attacker% ~ ~ ~ 5 5 5"
- heal the attacker
- on hunger meter change:
- player is in "spawn":
- cancel the event
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement