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
- format slot 0 of player with bread to close
- 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
- command /zestaw [<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> <nazwaZestawu>"
- 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 {_its::*} to all items in the player's inventory
- #set "kit.items" to "%{_its::*}%" in yaml file "{@folder}/kits/%arg 2%.yml"
- set "kit.autor" to "%player%" 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::*}%"
Advertisement
Add Comment
Please, Sign In to add comment