on load: if yaml path "ilosc" in file "plugins/Skript/Heads/Rodzaje/Inne/Flagi.yml" exists: set {_folder::*} to files in dir "/plugins/Skript/Heads/Rodzaje/" delete yaml list "Foldery" from file "plugins/Skript/Heads/Lista.yml" loop {_folder::*}: set {_path::%loop-index-1%::*} to loop-value split at "/" set {_size} to 0 loop {_path::%loop-index-1%::*}: add 1 to {_size} loop {_path::%loop-index-1%::*}: set {_index} to loop-index-2 parsed as integer if {_index} is {_size}: add loop-value-2 to yaml list "Foldery" from file "plugins/Skript/Heads/Lista.yml" else: set yaml value "a" from file "plugins/Skript/Heads/Lista.yml" to "" download from "https://pastebin.com/raw/yk8DKEkS" to "plugins/Skript/Heads/Lista.yml" wait second set {_yml::*} to yaml list "Linki" from file "plugins/Skript/Heads/Lista.yml" loop {_yml::*}: set {_path::*} to loop-value split at " " loop {_path::*}: if loop-value-2 contains "https://": set {_url} to loop-value-2 if loop-value-2 contains ".yml": set {_yml} to loop-value-2 if loop-value-2 does not contain ".yml" or "https://": set {_folder} to loop-value-2 set yaml value "a" from file "plugins/Skript/Heads/Rodzaje/%{_folder}%/%{_yml}%" to "" download from "%{_url}%" to "plugins/Skript/Heads/Rodzaje/%{_folder}%/%{_yml}%" wait 5 ticks command /head [] []: permission: pyra.heads permission message: Nie możesz tego użyć. aliases: pyrahead, ph, heads, glowki trigger: if arg 1 is not set: set {_chest} to chest with 6 rows named "Heads" loop 6*9 times: set slot (loop-number)-1 of {_chest} to 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::*} loop {_gui::*}: set slot loop-value of {_chest} to light gray glass set {_foldery::*} to yaml list "Foldery" from file "plugins/Skript/Heads/Lista.yml" loop {_foldery::*}: loop {_gui::*}: set slot loop-value-2 of {_chest} to sunflower named "%loop-value-1%" remove loop-value-2 from {_gui::*} stop loop set slot 49 of {_chest} to barrier named "&cKliknij aby zamknąć." close player's inventory wait 2 ticks open {_chest} to player if arg 1 is set: set {_foldery::*} to yaml list "Foldery" from file "plugins/Skript/Heads/Lista.yml" loop {_foldery::*}: if loop-value is arg 1: if arg 2 is not set: set {_chest} to chest with 6 rows named "Head:%arg 1%" loop 6*9 times: set slot (loop-number)-1 of {_chest} to gray glass set {_nazwa::*} to files in "plugins/Skript/Heads/Rodzaje/%arg 1%" 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::*} loop {_nazwa::*}: set {_loop} to loop-value-2 replace ".yml" with "" in {_loop} loop {_gui::*}: set slot loop-value-3 of {_chest} to nether star named "%{_loop}%" remove loop-value-3 from {_gui::*} stop loop loop {_gui::*}: set slot loop-value-2 of {_chest} to light gray glass set slot 49 of {_chest} to barrier named "&cKliknij aby powrócić." close player's inventory wait 2 ticks open {_chest} to player stop loop if arg 1 is set: if arg 2 is set: if {head::%arg 1%::%arg 2%} is not set: set {_nazwa::*} to files in "plugins/Skript/Heads/Rodzaje/%arg 1%" loop {_nazwa::*}: if loop-value is "%arg 2%.yml": set {_} to loop-index parsed as integer add 1 to {_} set {_after} to {_nazwa::%{_}%} remove 2 from {_} set {_before} to {_nazwa::%{_}%} stop loop set {_ilosc} to yaml value "ilosc" from file "plugins/Skript/Heads/Rodzaje/%arg 1%/%arg 2%.yml" set {head::%arg 1%::%arg 2%} to chest with 6 rows named "Head:%arg 1%:%arg 2%" if arg 1 is not "Custom": loop 45 times: set slot (loop-number)-1 of {head::%arg 1%::%arg 2%} to light gray glass loop {_ilosc} times: set {_item} to yaml value "bloki.%(loop-value)-1%" from file "plugins/Skript/Heads/Rodzaje/%arg 1%/%arg 2%.yml" set slot (loop-number)-1 of {head::%arg 1%::%arg 2%} to {_item} replace ".yml" with "" in {_before} replace ".yml" with "" in {_after} loop 9 times: set slot 54-(loop-number-1) of {head::%arg 1%::%arg 2%} to gray glass set slot 49 of {head::%arg 1%::%arg 2%} to barrier named "&cKliknij aby powrócić" if {_before} is set: set slot 47 of {head::%arg 1%::%arg 2%} to red glass named "&fPrzejdz do: %{_before}%" if {_after} is set: set slot 51 of {head::%arg 1%::%arg 2%} to light green glass named "&fPrzejdz do: %{_after}%" close player's inventory wait 2 ticks open {head::%arg 1%::%arg 2%} to player on inventory click: if name of player's current inventory contains "Head": cancel event set {_name::*} to name of player's current inventory split at ":" loop {_name::*}: if loop-index is "2": set {_folder} to loop-value if loop-index is "3": set {_file} to loop-value if name of player's current inventory contains "Custom:": if clicked item is head: if "%clicked type%" is "right mouse button with shift": set {_ilosc} to yaml value "ilosc" from file "plugins/Skript/Heads/Rodzaje/%{_folder}%/%{_file}%.yml" if {_ilosc} <= 45: set slot ({_ilosc}-1) of player's current inventory to 1 of clicked item set slot ({_ilosc}-1) of {head::%{_folder}%::%{_file}%} to 1 of clicked item set yaml value "ilosc" from file "plugins/Skript/Heads/Rodzaje/%{_folder}%/%{_file}%.yml" to {_ilosc}+1 set yaml value "bloki.%({_ilosc}-1)%" from file "plugins/Skript/Heads/Rodzaje/%{_folder}%/%{_file}%.yml" to 1 of clicked item if {_ilosc} = 45: set {_rozne} to yaml value "custom_ilosc" from file "plugins/Skript/Heads/Lista.yml" set yaml value "custom_ilosc" from file "plugins/Skript/Heads/Lista.yml" to {_rozne}+1 set yaml value "ilosc" from file "plugins/Skript/Heads/Rodzaje/%{_folder}%/Rozne_%{_rozne}%.yml" to 1 set {_item} to yaml value "Custom" from file "plugins/Skript/Heads/Lista.yml" set yaml value "bloki.0" from file "plugins/Skript/Heads/Rodzaje/%{_folder}%/Rozne_%{_rozne}%.yml" to {_item} delete {head::Custom::*} if size of {_name::*} = 3: if clicked item is head: if "%clicked type%" is not "right mouse button with shift": give 64 of clicked item to player if clicked slot = 49: make player execute command "/head %{_folder}%" if clicked slot is 47 or 51: if clicked item is red glass or light green glass: set {_name} to name of clicked item replace "&fPrzejdz do: " with "" in {_name} make player execute command "/head %{_folder}% %{_name}%" else: set {_name} to name of clicked item replace "&f" with "" in {_name} if size of {_name::*} = 1: if clicked slot = 49: close player's inventory else: if clicked item is not glass: make player execute command "/head %{_name}%" if size of {_name::*} = 2: if clicked slot = 49: make player execute command "/head" else: if clicked item is not glass: make player execute command "/head %{_folder}% %{_name}%" #Created by LuckyPotato v1.0