#AxBlock - Skrypt na zamiane sztabek w bloki on load: if yaml value "Gui.Name" from file "AxBlock/config.yml" is not set: create file "plugins/Skript/scripts/AxBlock/config.yml" wait 10 tick download from "https://pastebin.com/raw/uFcfKEdv" to "plugins/Skript/scripts/AxBlock/config.yml" send "&7Pobrano konfiguracje &aAxBlock" to console function returnYml(t: text) :: text: if yaml value "%{_t}%" from file "AxBlock/config.yml" is set: set {_text} to yaml value "%{_t}%" from file "AxBlock/config.yml" return "%{_text}%" else: return "" function Change(p: player, item: item, block: item, t: text): while {_p} has 9 of {_item}: remove 9 of {_item} from {_p} add {_block} to {_p} command /bloki []: aliases: /block trigger: open chest with (returnYml("Gui.Rows") parsed as number) rows named colored returnYml("Gui.Name") to player loop (yaml list "Gui.Background.Slots" from file "AxBlock/config.yml"): set player's current inventory's slot ("%loop-value%" parsed as number) to (returnYml("Gui.Background.Item") parsed as item) if returnYml("Gui.Background.Name") is not "": set name of player's current inventory's slot (("%loop-value%") parsed as number) to colored returnYml("Gui.Background.Name") if returnYml("Gui.Background.Lore") is not "": set lore of player's current inventory's slot (("%loop-value%") parsed as number) to colored returnYml("Gui.Background.lore") loop (yaml nodes "Gui.Slots" from file "AxBlock/config.yml"): set player's current inventory's slot (("%loop-value%") parsed as number) to ((returnYml("Gui.Slots.%loop-value%.Item")) parsed as item) if returnYml("Gui.Slots.%loop-value%.Name") is not "": set name of player's current inventory's slot (("%loop-value%") parsed as number) to colored returnYml("Gui.Slots.%loop-value%.Name") if returnYml("Gui.Slots.%loop-value%.Lore") is not "": set lore of player's current inventory's slot (("%loop-value%") parsed as number) to colored returnYml("Gui.Slots.%loop-value%.Lore") on inventory click: if inventory name of current inventory of player is colored returnYml("Gui.Name"): cancel event if returnYml("Gui.Slots.%clicked slot%.Change.Item") is set: while player has (returnYml("Gui.Slots.%clicked slot%.Change.Item") parsed as item): remove (returnYml("Gui.Slots.%clicked slot%.Change.Item") parsed as item) from player add (returnYml("Gui.Slots.%clicked slot%.Change.Block") parsed as item) to player