function giveItem(p: player, i: item): set lore of {_i} to "pyraHeads" give 64 of {_i} to {_p} loop all items in {_p}'s inventory: if lore of loop-item contains "pyraHeads": set 1st line of lore of loop-item to "" function getList(path: text) :: text: set {_folder::*} to files in dir "%{_path}%" loop {_folder::*}: set {_path::%loop-index-1%::*} to loop-value split at "/" set {_size} to size of {_path::%loop-index-1%::*} add {_path::%loop-index-1%::%{_size}%} to {_pliki::*} set {_files} to "%{_pliki::1}%" loop {_pliki::*}: if loop-index is not "1": set {_files} to "%loop-value%||%{_files}%" return {_files} on load: if getList(("plugins/Skript/")) contains "pyraHeads": stop set {_txt::*} to text from "https://pastebin.com/raw/qAU7Mmgy" split at " *** " loop {_txt::*}: set {_files::*} to loop-value split at " ||| " set {_main::*} to {_files::1} split at "||" set {_nbt::*} to {_files::2} split at " " create file "plugins/Skript/pyraHeads/%{_main::1}%/%{_main::2}%.txt" loop {_nbt::*}: wf "%loop-value-2%" to "plugins/Skript/pyraHeads/%{_main::1}%/%{_main::2}%.txt" if size of (getList(("plugins/Skript/pyraHeads/")) split at "||") = 9: send "&aPobieranie plikow zakonczone pomyslnie, wpisz /head aby rozpoczac." to all ops and console else: send "&cBlad pobierania plikow &epyra&6He&fa&6ds&r." to all ops and console command /head [] []: permission: pyraHeads.usage aliases: pyraheads, ph, heads trigger: close inventory of player if arg 1 is not set: open virtual chest inventory with 6 rows named "&e&lpyra&6&lHe&f&la&6&lds" to player format gui slot (integers from 0 to 53) of player with gray glass add 10, 11, 12, 13, 14, 15, 16, 19, 20, 21, 22, 23, 24, 25, 28, 29, 30, 31, 32, 33, 34, 37, 38, 39, 40, 41, 42 and 43 to {_gui::*} format gui slot {_gui::*} of player with light gray glass set {_main::*} to (getList(("plugins/Skript/pyraHeads/")) split at "||") loop {_main::*}: loop {_gui::*}: format gui slot loop-value-2 of player with 1 of sunflower named "&f%loop-value-1%" to run player command "/head %loop-value-1%" remove loop-value-2 from {_gui::*} stop loop else: if arg 2 is not set: if getList(("plugins/Skript/pyraHeads/")) contains arg 1: open virtual chest inventory with 6 rows named "&e&lp&6&lH&r:%arg 1%" to player set {_cat::*} to (getList(("plugins/Skript/pyraHeads/%arg 1%")) split at "||") format gui slot (integers from 0 to 53) of player with 1 of gray glass add 10, 11, 12, 13, 14, 15, 16, 19, 20, 21, 22, 23, 24, 25, 28, 29, 30, 31, 32, 33, 34, 37, 38, 39, 40, 41, 42 and 43 to {_gui::*} format gui slot {_gui::*} of player with 1 of light gray glass loop {_cat::*}: loop {_gui::*}: replace ".txt" with "" in {_cat::%loop-index-1%} format gui slot loop-value-2 of player with 1 of nether star named "&f%{_cat::%loop-index-1%}%" to run player command "/head %arg 1% %{_cat::%loop-index-1%}%" remove loop-value-2 from {_gui::*} stop loop format gui slot 49 of player with barrier named "&cPowrót do Strony Głównej" to run player command "/head" else: open virtual chest inventory with 6 rows named "&e&lp&6&lH&r:%arg 1%:%arg 2%" to player format gui slot (integers from 0 to 44) of player with 1 of light gray glass set {_items::*} to file contents of "plugins/Skript/pyraHeads/%arg 1%/%arg 2%.txt" loop {_items::*}: format gui slot ((loop-index parsed as integer)-1) of player with player head with custom nbt tag "%loop-value%" to run function giveItem(player, (player head with custom nbt tag "%loop-value%")) format gui slot (integers between 45 and 53) of player with 1 of gray glass format gui slot 49 of player with barrier named "&cPowrót do %arg 1%" to run player command "/head %arg 1%" set {_files::*} to (getList(("plugins/Skript/pyraHeads/%arg 1%/")) split at "||") loop {_files::*}: replace ".txt" with "" in {_files::%loop-index%} loop {_files::*}: if loop-value is arg 2: if (loop-index parsed as integer) < (size of {_files::*}): format gui slot 51 of player with 1 of light green glass named "&fNastępna strona: %{_files::%(loop-index parsed as integer)+1%}%" to run player command "/head %arg 1% %{_files::%(loop-index parsed as integer)+1%}%" if (loop-index parsed as integer) is not 1: format gui slot 47 of player with 1 of red glass named "&fPoprzednia strona: %{_files::%(loop-index parsed as integer)-1%}%" to run player command "/head %arg 1% %{_files::%(loop-index parsed as integer)-1%}%" stop loop #Created by LuckyPotato v2.1