Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #Beta 2.0#
- options:
- logo: &bDuel &7>>
- variables:
- {iloscaren} = 0
- {saveInventory} = false
- on sign change:
- if line 1 is "duel":
- if line 2 is "dolacz" or "join":
- if line 3 is set:
- if file "plugins/Duel/areny/%uncolored line 3%.yml" exists:
- set line 1 to "&bDuel"
- set line 2 to "&aDolacz"
- set line 3 to "%uncolored line 3%"
- else:
- set line 3 to "&4ERROR"
- if line 1 is "duel":
- if line 2 is "status":
- if line 3 is set:
- if file "plugins/Duel/areny/%uncolored line 3%.yml" exists:
- set line 1 to "&bDuel"
- set line 2 to "&aStatus"
- set line 3 to "%uncolored line 3%"
- else:
- set line 3 to "&4ERROR"
- on rightclick on sign:
- if line 1 of clicked block is "&bDuel":
- if line 2 of clicked block is "&aDolacz":
- if line 3 of clicked block is set:
- execute player command "duel dolacz %uncolored line 3%"
- stop
- if line 1 of clicked block is "&bDuel":
- if line 2 of clicked block is "&aStatus":
- if line 3 of clicked block is set:
- send "&aStatus areny &b%line 3%"
- send "&7>> &cW grze: &a%{start.%uncolored line 3%}%"
- send "&7>> &cGraczy na arenie: &a%{gracze.%uncolored line 3%}%"
- stop
- on load:
- if folder "plugins/Duel" doesn't exists:
- create folder "plugins/Duel"
- create folder "plugins/Duel/areny"
- create file "plugins/Duel/config.yml"
- set "cfg.saveInv" to "false" in yaml file "plugins/Duel/config.yml"
- else:
- set {_req} to single value "cfg.saveInv" get of "plugins/Duel/config.yml" parsed as boolean
- set {saveInventory} to {_req}
- set {_version} to content of file "plugins/Skript/scripts/%script%.sk"
- set {_v} to index of "##" in {_version}
- set {_v2} to subtext of {_version} from character ({_v}+1) to character (length of {_version})
- set {_v3} to index of "##" in {_v2}
- set {version} to subtext of {_version} from character ({_v}+1) to character ({_v3})
- set {_version} to result of connect to "https://pastebin.com/raw/UfHan3Df"
- set {version.new} to subtext of {_version} from character ({_v}+1) to character ({_v3})
- {version} is not {version.new}:
- send "&aDostepna jest nowa wersja skryptu! Pobierz ja /duel pobierz" to console
- command /duel [<text>] [<text>] [<text>]:
- trigger:
- if arg 1 is not set:
- send "&aKomendy &bDuel&a:"
- send "&7/duel dolacz <arena> - &aDolaczasz do areny"
- send "&7/duel opusc <arena> - &aOpuszczasz arene"
- send "&7/duel lista - &aLista aren"
- send "&7/duel profil - &aPokazuje twoj profil"
- send "&7/duel ranking - &aPokazuje ranking graczy"
- if player has permission "sduel.admin":
- send "&7/duel stworz <arena> - &aTworzy arene"
- send "&7/duel ustaw spawn1/2 <arena> - &aUstawia spawn 1 i 2 na danej arenie"
- send "&7/duel zapisz ekwipunek <arena> - &aZapisuje ekwipunek na danej arenie"
- send "&7/duel wczytaj ekwipunek <arena> - &aWczytuje (w celach testowych) ekwipunek danej areny"
- send "&7/duel dodaj nagroda <arena> - &aDodaje item z reki do listy nagrod danej areny"
- send "&7/duel przenies lobby <arena> - &aUstawia lobby dla danej areny"
- send "&7/duel usun <arena> - &aUsuwa arene"
- send "&7/duel wersja - &aPokazuje informacje o wersji"
- send "&7/duel pobierz - &aPobiera najnowsza wersje"
- send "&7/duel profil <nick> - &aPokazuje profil gracza"
- if arg 1 is "pobierz" or "download":
- set {_version} to result of connect to "https://pastebin.com/raw/UfHan3Df"
- set {_v} to index of "##" in {_version}
- set {_v2} to subtext of {_version} from character ({_v}+1) to character (length of {_version})
- set {_v3} to index of "##" in {_v2}
- set {version.new} to subtext of {_version} from character ({_v}+1) to character ({_v3})
- {version} is not {version.new}:
- download "https://pastebin.com/raw/UfHan3Df" to "plugins/Skript/scripts/%script%.sk"
- send "{@logo} &aNajnowsza wersja zostala pobrana przeladuj skrypt!"
- else:
- send "{@logo} &c&nPosiadasz aktualna wersje skryptu!"
- stop
- if arg 1 is "wersja" or "version":
- set {_version} to result of connect to "https://pastebin.com/raw/UfHan3Df"
- set {_v} to index of "##" in {_version}
- set {_v2} to subtext of {_version} from character ({_v}+1) to character (length of {_version})
- set {_v3} to index of "##" in {_v2}
- set {version.new} to subtext of {_version} from character ({_v}+1) to character ({_v3})
- send "{@logo} &aTwoja wersja to %{version}%"
- send "{@logo} &aNajnowsza wersja to %{version.new}%"
- {version} is not {version.new}:
- send "{@logo} &aDostepna jest nowa wersja skryptu!"
- if arg 1 is "dolacz" or "join":
- if arg 2 is set:
- if {wgrze.%player%} is false:
- if file "plugins/Duel/areny/%arg 2%.yml" exists:
- if {gracze.%arg 2%} < 2:
- if {start.%arg 2%} is false:
- add 1 to {gracze.%arg 2%}
- if {spawn1.%arg 2%} is true:
- clear inventory of player
- set player's helmet to air
- set player's chestplate to air
- set player's leggings to air
- set player's boots to air
- set {_s1X} to single value "info.spawn1X" get of "plugins/Duel/areny/%arg 2%.yml" parsed as number
- set {_s1Y} to single value "info.spawn1Y" get of "plugins/Duel/areny/%arg 2%.yml" parsed as number
- set {_s1Z} to single value "info.spawn1Z" get of "plugins/Duel/areny/%arg 2%.yml" parsed as number
- set {_s1W} to single value "info.spawn1World" get of "plugins/Duel/areny/%arg 2%.yml" parsed as world
- set {_loc1} to location at ({_s1X}, {_s1Y}, {_s1Z}) of world {_s1W}
- teleport player to {_loc1}
- set {wgrze.%player%.%arg 2%} to true
- set {wgrze.%player%} to true
- if {saveInventory} is true:
- set {oldequip.%player%} to serialized inventory of player
- set {oldhelm.%player%} to "%helmet of the player%"
- set {oldklata.%player%} to "%chestplate of the player%"
- set {oldspodnie.%player%} to "%legging of the player%"
- set {oldbuty.%player%} to "%boots of the player%"
- restore inventory of player from {ekwipunek.%arg 2%}
- equip the player with {helm.%arg 2%} parsed as item
- equip the player with {klata.%arg 2%} parsed as item
- equip the player with {spodnie.%arg 2%} parsed as item
- equip the player with {buty.%arg 2%} parsed as item
- apply slowness 255 to the player for 9999999 second
- set {spawn1.%arg 2%} to false
- else:
- clear inventory of player
- set player's helmet to air
- set player's chestplate to air
- set player's leggings to air
- set player's boots to air
- set {_s2X} to single value "info.spawn2X" get of "plugins/Duel/areny/%arg 2%.yml" parsed as number
- set {_s2Y} to single value "info.spawn2Y" get of "plugins/Duel/areny/%arg 2%.yml" parsed as number
- set {_s2Z} to single value "info.spawn2Z" get of "plugins/Duel/areny/%arg 2%.yml" parsed as number
- set {_s2W} to single value "info.spawn2World" get of "plugins/Duel/areny/%arg 2%.yml" parsed as world
- set {_loc2} to location at ({_s2X}, {_s2Y}, {_s2Z}) of world {_s2W}
- teleport player to {_loc2}
- set {wgrze.%player%.%arg 2%} to true
- set {wgrze.%player%} to true
- if {saveInventory} is true:
- set {oldequip.%player%} to serialized inventory of player
- set {oldhelm.%player%} to "%helmet of the player%"
- set {oldklata.%player%} to "%chestplate of the player%"
- set {oldspodnie.%player%} to "%legging of the player%"
- set {oldbuty.%player%} to "%boots of the player%"
- restore inventory of player from {ekwipunek.%arg 2%}
- equip the player with {helm.%arg 2%} parsed as item
- equip the player with {klata.%arg 2%} parsed as item
- equip the player with {spodnie.%arg 2%} parsed as item
- equip the player with {buty.%arg 2%} parsed as item
- apply slowness 255 to the player for 9999999 second
- set {start.%arg 2%} to true
- loop all players:
- if {wgrze.%loop-player%.%arg 2%} is true:
- send "{@logo} &aGra rozpocznie sie za 5 sekund" to loop-player
- wait 1 second
- loop all players:
- if {wgrze.%loop-player%.%arg 2%} is true:
- send "{@logo} &aGra rozpocznie sie za 4 sekundy" to loop-player
- wait 1 second
- loop all players:
- if {wgrze.%loop-player%.%arg 2%} is true:
- send "{@logo} &aGra rozpocznie sie za 3 sekundy" to loop-player
- wait 1 second
- loop all players:
- if {wgrze.%loop-player%.%arg 2%} is true:
- send "{@logo} &aGra rozpocznie sie za 2 sekundy" to loop-player
- wait 1 second
- loop all players:
- if {wgrze.%loop-player%.%arg 2%} is true:
- send "{@logo} &aGra rozpocznie sie za 1 sekunde" to loop-player
- wait 1 second
- loop all players:
- if {wgrze.%loop-player%.%arg 2%} is true:
- remove slowness from loop-player
- send "{@logo} &aGra rozpoczela sie!" to loop-player
- stop
- else:
- send "{@logo} &c&nArena juz wystartowala!"
- stop
- else:
- send "{@logo} &c&nLimit osob osiagniety!"
- stop
- else:
- send "{@logo} &c&nTaka arena nie istnieje!"
- stop
- else:
- send "{@logo} &c&nJuz jestes w grze!"
- stop
- else:
- send "{@logo} &c&nPodaj nazwe areny!"
- stop
- if arg 1 is "dodaj" or "add":
- if player has permission "sduel.admin":
- if arg 2 is "nagroda" or "prize":
- if arg 3 is set:
- if file "plugins/Duel/areny/%arg 3%.yml" exists:
- set {_item} to player's tool
- add {_item} to {prize.%arg 3%::*}
- send "{@logo} &aNagroda zostala dodana!"
- stop
- else:
- send "{@logo} &c&nArena nie istnieje!"
- stop
- else:
- send "{@logo} &c&nPodaj nazwe areny!"
- stop
- else:
- send "{@logo} &c&nZly argument!"
- stop
- else:
- send "{@logo} &c&nBrak uprawnien!"
- stop
- if arg 1 is "opusc":
- if arg 2 is set:
- if file "plugins/Duel/areny/%arg 2%.yml" exists:
- if {wgrze.%player%.%arg 2%} is true:
- if {start.%arg 2%} is false:
- set {wgrze.%player%} to false
- set {wgrze.%player%.%arg 2%} to false
- set {gracze.%arg 2%} to 0
- set {spawn1.%arg 2%} to true
- clear inventory of player
- teleport player to spawn
- remove slowness from player
- send "{@logo} &aOpusciles gre!"
- stop
- else:
- send "{@logo} &c&nNie mozesz opuscic gry!"
- stop
- else:
- send "{@logo} &c&nNie grasz na tej arenie!"
- stop
- else:
- send "{@logo} &c&nArena nie istnieje!"
- stop
- else:
- send "{@logo} &c&nPodaj nazwe areny!"
- stop
- if arg 1 is "stworz" or "create":
- if player has permission "sduel.admin":
- if arg 2 is set:
- if file "plugins/Duel/areny/%arg 2%.yml" doesn't exists:
- create file "plugins/Duel/areny/%arg 2%.yml"
- add arg 2 to {listaaren.duel::*}
- set {start.%arg 2%} to false
- set {gracze.%arg 2%} to 0
- set {spawn1.%arg 2%} to true
- loop all players:
- set {wgrze.%loop-player%.%arg 2%} to false
- add 1 to {iloscaren}
- send "{@logo} &aArena &b%arg 2% &azostala stworzona!"
- stop
- else:
- send "{@logo} &c&nTaka arena juz istnieje!"
- stop
- else:
- send "{@logo} &c&nPodaj nazwe areny!"
- stop
- else:
- send "{@logo} &c&nBrak uprawnien!"
- stop
- if arg 1 is "ustaw" or "set":
- if player has permission "sduel.admin":
- if arg 2 is "spawn1":
- if arg 3 is set:
- if file "plugins/Duel/areny/%arg 3%.yml" exists:
- set {_spawn1X} to "%x-coordinate of player%"
- set {_spawn1Y} to "%y-coordinate of player%"
- set {_spawn1Z} to "%z-coordinate of player%"
- set {_spawn1World} to "%world of player%"
- set "info.spawn1X" to "%{_spawn1X}%" in yaml file "plugins/Duel/areny/%arg 3%.yml"
- set "info.spawn1Y" to "%{_spawn1Y}%" in yaml file "plugins/Duel/areny/%arg 3%.yml"
- set "info.spawn1Z" to "%{_spawn1Z}%" in yaml file "plugins/Duel/areny/%arg 3%.yml"
- set "info.spawn1World" to "%{_spawn1World}%" in yaml file "plugins/Duel/areny/%arg 3%.yml"
- send "{@logo} &aSpawn 1 dla areny &b%arg 3% &azostal ustawiony &7(&6x: %{_spawn1X}%,y: %{_spawn1Y}%,z: %{_spawn1Z}%&7)"
- stop
- else:
- send "{@logo} &c&nTaka arena nie istnieje!"
- stop
- else:
- send "{@logo} &c&nPodaj nazwe areny!"
- stop
- if arg 2 is "spawn2":
- if arg 3 is set:
- if file "plugins/Duel/areny/%arg 3%.yml" exists:
- set {_spawn2X} to "%x-coordinate of player%"
- set {_spawn2Y} to "%y-coordinate of player%"
- set {_spawn2Z} to "%z-coordinate of player%"
- set {_spawn2World} to "%world of player%"
- set "info.spawn2X" to "%{_spawn2X}%" in yaml file "plugins/Duel/areny/%arg 3%.yml"
- set "info.spawn2Y" to "%{_spawn2Y}%" in yaml file "plugins/Duel/areny/%arg 3%.yml"
- set "info.spawn2Z" to "%{_spawn2Z}%" in yaml file "plugins/Duel/areny/%arg 3%.yml"
- set "info.spawn2World" to "%{_spawn2World}%" in yaml file "plugins/Duel/areny/%arg 3%.yml"
- send "{@logo} &aSpawn 2 dla areny &b%arg 3% &azostal ustawiony &7(&6x: %{_spawn2X}%,y: %{_spawn2Y}%,z: %{_spawn2Z}%&7)"
- stop
- else:
- send "{@logo} &c&nTaka arena nie istnieje!"
- stop
- else:
- send "{@logo} &c&nPodaj nazwe areny!"
- stop
- else:
- send "{@logo} &c&nBrak uprawnien!"
- stop
- if arg 1 is "zapisz" or "save":
- if player has permission "sduel.admin":
- if arg 2 is "ekwipunek" or "inventory":
- if arg 3 is set:
- if file "plugins/Duel/areny/%arg 3%.yml" exists:
- set {ekwipunek.%arg 3%} to serialized inventory of player
- set {helm.%arg 3%} to "%helmet of the player%"
- set {klata.%arg 3%} to "%chestplate of the player%"
- set {spodnie.%arg 3%} to "%legging of the player%"
- set {buty.%arg 3%} to "%boots of the player%"
- send "{@logo} &aEkwipunek dla areny &b%arg 3% &azostal ustawiony!"
- stop
- else:
- send "{@logo} &c&nTaka arena nie istnieje!"
- stop
- else:
- send "{@logo} &c&nPodaj nazwe areny!"
- stop
- else:
- send "{@logo} &c&nZly argument!"
- stop
- else:
- send "{@logo} &c&nBrak uprawnien!"
- stop
- if arg 1 is "wczytaj" or "load":
- if player has permission "sduel.admin":
- if arg 2 is "ekwipunek" or "inventory":
- if arg 3 is set:
- if file "plugins/Duel/areny/%arg 3%.yml" exists:
- restore inventory of player from {ekwipunek.%arg 3%}
- equip the player with {helm.%arg 3%} parsed as item
- equip the player with {klata.%arg 3%} parsed as item
- equip the player with {spodnie.%arg 3%} parsed as item
- equip the player with {buty.%arg 3%} parsed as item
- send "{@logo} &aEkwipunek dla areny &b%arg 3% &azostal wczytany!"
- stop
- else:
- send "{@logo} &c&nTaka arena nie istnieje!"
- stop
- else:
- send "{@logo} &c&nPodaj nazwe areny!"
- stop
- else:
- send "{@logo} &c&nZly argument!"
- stop
- else:
- send "{@logo} &c&nBrak uprawnien!"
- stop
- if arg 1 is "przenies" or "move":
- if player has permission "sduel.admin":
- if arg 2 is "lobby":
- if arg 3 is set:
- if file "plugins/Duel/areny/%arg 3%.yml" exists:
- set {lobby.%arg 3%} to location of player
- send "{@logo} &aUstawiono lobby dla areny &b%arg 3%"
- stop
- else:
- send "{@logo} &c&nTaka arena nie istnieje!"
- stop
- else:
- send "{@logo} &c&nPodaj nazwe areny!"
- stop
- else:
- send "{@logo} &c&nZly argument!"
- stop
- else:
- send "{@logo} &c&nBrak uprawnien!"
- stop
- if arg 1 is "usun" or "delete":
- if player has permission "sduel.admin":
- if arg 2 is set:
- if file "plugins/Duel/areny/%arg 2%.yml" exists:
- remove arg 2 from {listaaren.duel::*}
- remove 1 from {iloscaren}
- loop all players:
- if {wgrze.%loop-player%.%arg 2%} is true:
- set {wgrze.%loop-player%.%arg 2%} to false
- delete {start.%arg 2%}
- delete {gracze.%arg 2%}
- delete {spawn1.%arg 2%}
- delete {ekwipunek.%arg 2%}
- delete {helm.%arg 2%}
- delete {klata.%arg 2%}
- delete {spodnie.%arg 2%}
- delete {buty.%arg 2%}
- delete file "plugins/Duel/areny/%arg 2%.yml"
- send "{@logo} &aArena &b%arg 2% &azostala usunieta!"
- stop
- else:
- send "{@logo} &c&nTaka arena nie istnieje!"
- stop
- else:
- send "{@logo} &c&nPodaj nazwe areny!"
- stop
- else:
- send "{@logo} &c&nBrak uprawnien!"
- stop
- if arg 1 is "lista":
- send "{@logo} &aAreny: &6%{listaaren.duel::*}%"
- if arg 1 is "profil":
- if arg 2 isn't set:
- open chest with 3 rows named "&aTwoj profil" to player
- wait 1 tick
- format slot 10 of player with 1 of green wool named "&aWygrane: &6%{wygrane.%player%}%" to be unstealable
- format slot 13 of player with 1 of paper named "&aPunkty: &6%{punkty.%player%}%" to be unstealable
- format slot 16 of player with 1 of red wool named "&aPrzegrane: &6%{przegrane.%player%}%" to be unstealable
- else:
- if player has permission "sduel.admin":
- set {_my} to player
- if arg 2 isn't {_my}:
- open chest with 3 rows named "&aProfil uzytkownika &6%arg 2%" to player
- wait 1 tick
- format slot 10 of player with 1 of green wool named "&aWygrane: &6%{wygrane.%arg 2%}%" to be unstealable
- format slot 13 of player with 1 of paper named "&aPunkty: &6%{punkty.%arg 2%}%" to be unstealable
- format slot 16 of player with 1 of red wool named "&aPrzegrane: &6%{przegrane.%arg 2%}%" to be unstealable
- else:
- send "{@logo} &c&nAby otworzyc swoj profil wpisz /duel profil"
- stop
- if arg 1 is "ranking":
- open chest with 1 rows named "&aRanking osob online" to player
- set {_wyn} to 0
- loop all players:
- if {_wyn} < 5:
- if {punkty.%loop-player%} > 0:
- format slot {_wyn} of player with 1 of paper named "&c%loop-player%" with lore "&aPunkty: &6%{punkty.%loop-player%}%" to be unstealable
- add 1 to {_wyn}
- format slot 6 of player with 1 of glass pane named "" with lore "" to be unstealable
- format slot 8 of player with 1 of feather named "&aInformacje" with lore "&cRanking dotyczy tylko osob online!" to be unstealable
- on first join:
- set {wgrze.%player%} to false
- loop {iloscaren} times:
- set {wgrze.%player%.%loop-value%} to false
- on death of player:
- if {wgrze.%victim%} is true:
- set {wgrze.%victim%} to false
- loop {listaaren.duel::*}:
- if {wgrze.%attacker%.%loop-value%} is true:
- set {wgrze.%victim%.%loop-value%} to false
- set {wgrze.%attacker%.%loop-value%} to false
- set {wgrze.%attacker%} to false
- set {gracze.%loop-value%} to 0
- set {start.%loop-value%} to false
- set {spawn1.%loop-value%} to true
- teleport attacker to {lobby.%loop-value%}
- teleport victim to {lobby.%loop-value%}
- clear inventory of attacker
- add random element out of {prize.%loop-value%::*} to attacker
- add 1 to {wygrane.%attacker%}
- set {_p1} to "%random integer between 1 and 5%" parsed as integer
- add {_p1} to {punkty.%attacker%}
- send "{@logo} &aWygrales arene &b%loop-value% &a! &6(+%{_p1}%)" to attacker
- add 1 to {przegrane.%victim%}
- send "{@logo} &aPrzegrales gre na arenie &b%loop-value% &a! &6(+0)" to victim
- if {saveInventory} is true:
- restore inventory of attacker from {oldequip.%attacker%}
- equip the attacker with {oldhelm.%attacker%} parsed as item
- equip the attacker with {oldklata.%attacker%} parsed as item
- equip the attacker with {oldspodnie.%attacker%} parsed as item
- equip the attacker with {oldbuty.%attacker%} parsed as item
- restore inventory of victim from {oldequip.%victim%}
- equip the victim with {oldhelm.%victim%} parsed as item
- equip the victim with {oldklata.%victim%} parsed as item
- equip the victim with {oldspodnie.%victim%} parsed as item
- equip the victim with {oldbuty.%victim%} parsed as item
- on disconnect:
- if {wgrze.%player%} is true:
- set {wgrze.%player%} to false
- loop {listaaren.duel::*}:
- if {wgrze.%player%.%loop-value%} is true:
- if {start.%loop-value%} is true:
- set {wgrze.%player%.%loop-value%} to false
- set {gracze.%loop-value%} to 0
- set {start.%loop-value%} to false
- set {spawn1.%loop-value%} to true
- add 1 to {przegrane.%player%}
- kill player
- set {_rq} to loop-value
- loop all players:
- if {wgrze.%loop-player%.%{_rq}%} is true:
- add 1 to {wygrane.%loop-player%}
- send "{@logo} &aTwoj partner sie wylogowal. Mozesz opuscic gre &7(/duel opusc %{_rq}%)" to loop-player
- add random element out of {prize.%loop-value%::*} to loop-player
Advertisement
Add Comment
Please, Sign In to add comment