# Author: Nawo # Contact: romug1337@gmail.com options: world: standard countdown: 5 variables: {duel::status::%player%} = "before" {duel::player::%player%::kill} = 0 {duel::player::%player%::death} = 0 on damage of player: if attacker is a player: if attacker is in world "standard": if {duel::status::%attacker%} is "before": cancel event if {duel::status::%victim%} is "before": if {duel::opponent::%victim%} is "%attacker%": set {duel::status::%attacker%} to "countdown" set {duel::status::%victim%} to "countdown" set {duel::opponent::%victim%} to "%attacker%" set {_sec%attacker%} to {@countdown} loop {@countdown} times: if {duel::status::%attacker%} is "countdown": send "&a&lPrzygotuj sie! Walka z &6&l%victim% &a&lZacznie sie za &6&l%{_sec%attacker%}% &a&lsek!" to attacker send "&a&lPrzygotuj sie! Walka z &6&l%attacker% &a&lZacznie sie za &6&l%{_sec%attacker%}% &a&lsek!" to victim play raw sound "note.pling" at attacker with pitch 1 volume 5 play raw sound "note.pling" at victim with pitch 1 volume 5 wait 1 seconds remove 1 from {_sec%attacker%} else: exit loop if {duel::status::%attacker%} is "countdown": play raw sound "note.pling" at attacker with pitch 2 volume 5 play raw sound "note.pling" at victim with pitch 2 volume 5 set {duel::status::%attacker%} to "during" set {duel::status::%victim%} to "during" else if {duel::opponent::%victim%} is not "%attacker%": if {duel::opponent::%attacker%} is not "%victim%": send "&2Zaproszenie do walki zostalo wyslane do gracza &6&l%victim%" to attacker send "&2Zostales zaproszony do walki przez gracza &6&l%attacker%" to victim set {duel::opponent::%attacker%} to "%victim%" else if {duel::opponent::%attacker%} is "%victim%": send "&2Ten gracz otrzymal juz zaproszenie do walki!" to attacker else if {duel::status::%victim%} is "during" or "countdown": send "&2Ten gracz jest juz podczas walki!" if {duel::status::%attacker%} is "countdown": cancel event if {duel::status::%attacker%} is "during": if "%victim%" is not "%{duel::opponent::%attacker%}%": stop on death of player: if attacker is a player: if attacker is in world "standard": launch flickering trailing ball firework colored white at attacker timed 2 clear drops add 1 to {duel::player::%attacker%::kill} add 1 to {duel::player::%victim%::death} reveal all players to attacker reveal all players to victim send "&eGracz &a%attacker% &ewygral walke z &c%victim% &7(%attacker's health%&c❤&7)" to all players in world "standard" heal attacker execute console command "/clear %player%" set {logout::%attacker%} to 0 wait 1.5 seconds set {duel::status::%attacker%} to "before" set {duel::status::%victim%} to "before" set {duel::opponent::%victim%} to "none" set {duel::opponent::%attacker%} to "none" on quit: reveal all players to {duel::status::%{duel::opponent::%player%}%} set {duel::status::%player%} to "before" set {duel::status::%{duel::opponent::%player%}%} to "before" set {duel::opponent::%{duel::opponent::%player%}%} to "none" set {duel::opponent::%player%} to "none"