Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- options:
- tag: &8[&9Duels&8]
- folder: plugins/Duels
- on script load:
- if folder "{@folder}" doesn't exists:
- create folder "{@folder}"
- create folder "{@folder}/kits"
- create folder "{@folder}/arens"
- create folder "{@folder}/users"
- create file "{@folder}/config.yml"
- command /duel [<player>]:
- trigger:
- if arg 1 isn't set:
- send "{@tag} &cPodaj gracza z ktorym chcesz walczyc."
- stop
- if player-arg 1 is online:
- if file "{@folder}/%player%.yml" doesn't exists:
- if file "{@folder}/%arg 1%.yml" doesn't exists:
- open chest with 3 rows named "&eWybierz zestaw" to player
- set {_i} to 0
- loop 10 times:
- set player's current inventory's slot {_i} to gray glass pane named " "
- add 1 to {_i}
- set {_c} to 17
- loop 10 times:
- set player's current inventory's slot {_c} to gray glass pane named " "
- add 1 to {_c}
- set {_x::*} to files in "{@folder}/kits"
- send "%size of {_x::*}% - %{_x::*}%"
- #10-17
- set {_i} to 10
- loop 7 times:
- if "%{_x::%loop-number%}%" is "<none>":
- exit loop
- set {_name} to {_x::%loop-number%}
- set {_item} to single value "kit.item" get of "{@folder}/kits/%{_name}%" parsed as item type
- replace all ".yml" with "" in {_name}
- if {_item} is item type:
- set player's current inventory's slot {_i} to {_item} named "&c%{_name}%"
- else:
- set player's current inventory's slot {_i} to diamond sword named "&c%{_name}%"
- add 1 to {_i}
- stop
- else:
- send "{@tag} &cTen gracz jest juz podczas walki."
- stop
- else:
- send "{@tag} &cJestes juz podczas walki."
- stop
- else:
- send "{@tag} &cTen gracz jest offline."
- stop
- on inventory click:
- if "%inventory name of player's current inventory%" contains "Wybierz zestaw":
- if slot is smaller than 0:
- stop
- cancel event
- if player's current inventory's slot slot is diamond sword:
- set {_kit} to uncoloured name of player's current inventory's slot slot
- #Kod na wybor kitu....
- command /zestaw [<text>] [<text>] [<text>]:
- trigger:
- if player has permission "duels.*" or "duels.kit":
- if arg 1 isn't set:
- send "{@tag} &cPoprawne uzycie: &7/zestaw <add/remove/info/item/daj> <nazwaZestawu> *<przedmiot>*"
- stop
- if arg 1 is "add" or "set":
- if arg 2 is set:
- if arg 2's length is bigger than or equal to 3:
- create file "{@folder}/kits/%arg 2%.yml"
- set {_n} to arg 2
- set "kit.nazwa" to "%{_n}%" in yaml file "{@folder}/kits/%arg 2%.yml"
- set {_i} to 1
- loop all items in player's inventory:
- set "kit.items.%{_i}%" to "%loop-item%" in yaml file "{@folder}/kits/%arg 2%.yml"
- add 1 to {_i}
- set "kit.autor" to "%player%" in yaml file "{@folder}/kits/%arg 2%.yml"
- set "kit.item" to "stick" in yaml file "{@folder}/kits/%arg 2%.yml"
- send "{@tag} &aStworzyles nowy zestaw o nazwie: &1%arg 2%"
- stop
- else:
- send "{@tag} &cNazwa musi zawierac min. 3 znaki."
- stop
- if arg 1 is "info":
- if arg 2 is set:
- if file "{@folder}/kits/%arg 2%.yml" exists:
- send ""
- send "&eZestaw: &7%arg 2%"
- set {_n} to single value "kit.nazwa" get of "{@folder}/kits/%arg 2%.yml"
- set {_c::*} to configuration section "kit.items" get of "{@folder}/kits/%arg 2%.yml"
- loop {_c::*}:
- add single value "kit.items.%loop-index%" get of "{@folder}/kits/%arg 2%.yml" to {_items::*}
- set {_b} to single value "kit.autor" get of "{@folder}/kits/%arg 2%.yml"
- send "&eNazwa: &7%{_n}%"
- send "&ePrzedmioty: &7%{_items::*}%"
- send "&eAutor: &7%{_b}%"
- else:
- set {_kitsy::*} to all files in "{@folder}/kits"
- loop {_kitsy::*}:
- replace all ".yml" in {_kitsy::%loop-index%} with ""
- send "{@tag} &cDostepne zestawy: &7%{_kitsy::*}%"
- if arg 1 is "daj":
- if arg 2 is set:
- if file "{@folder}/kits/%arg 2%.yml" exists:
- set {_its::*} to configuration section "kit.items" get of "{@folder}/kits/%arg 2%.yml"
- loop {_its::*}:
- set {_i} to single value "kit.items.%loop-index%" get of "{@folder}/kits/%arg 2%.yml" parsed as item type
- send "%{_i}%"
- give {_i} to player
- send "{@tag} &aOtrzymales zestaw &7%arg 2%"
- else:
- set {_kitsy::*} to all files in "{@folder}/kits"
- loop {_kitsy::*}:
- replace all ".yml" in {_kitsy::%loop-index%} with ""
- if {_kitsy::*} is not set:
- add "-" to {_kitsy::*}
- send "{@tag} &cDostepne zestawy: &7%{_kitsy::*}%"
- if arg 1 is "item":
- if arg 2 is set:
- if file "{@folder}/kits/%arg 2%.yml" exists:
- if arg 3 is set:
- set {_arg} to "%arg 3%" parsed as item type
- if {_arg} is item type:
- set "kit.item" to "%arg 3%" in yaml file "{@folder}/kits/%arg 2%.yml"
- send "{@tag} &aUstawiles przedmiot zestawu &7%arg 2% &ana &7%arg 3%"
- stop
- else:
- send "{@tag} &7%arg 3% &cnie jest typem przedmiotu."
- stop
- else:
- send "{@tag} &cPoprawne uzycie: &7/zestaw item <zestaw> <przedmiot>"
- stop
- else:
- send "{@tag} &cPodany zestaw nie istnieje."
- stop
- else:
- send "{@tag} &cPoprawne uzycie: &7/zestaw item <zestaw> <przedmiot>"
- stop
Advertisement
Add Comment
Please, Sign In to add comment