options: vsz: 4 tag: &9jShop &8> on script load: if dir "plugins/Skript/scripts/jshop" doesn't exist: create dir "plugins/Skript/scripts/jshop" download file from "https://pastebin.com/raw/E84hDhcv" to file "plugins/Skript/scripts/jshop/worth.yml" on sign change: if line 1 is "[Shop]": if player has permission "jshop.create": if line 2 is not empty: if yaml value "%line 2%.item" from "plugins/Skript/scripts/jshop/worth.yml" is set: set line 1 to "&a[Sklep]" set line 3 to line 2 set line 2 to "" set line 4 to "" send "{@tag} &aSklep został pomyślnie utworzony!" else: set event-block to air drop 1 sign at event-block send "{@tag} &cNajpierw dodaj &e%line 2%&c w configu!" else: set event-block to air drop 1 sign at event-block send "{@tag} &cPodaj nazwe przedmiotu!" else: set event-block to air drop 1 sign at event-block send "{@tag} &cNie posiadasz uprawnień &ejshop.create" if line 1 is "&a[Sklep]": if player has permission "jshop.create": wait 1 tick else: set event-block to air drop 1 sign at event-block on rightclick on sign: if line 1 is "&a[Sklep]": execute console command "sklep open %line 3% %player%" command /sklep [] [] [] [] []: trigger: if arg 1 is set: if arg 1 is "open": if sender is not console: stop open chest with 1 row named arg 2 to arg-player wait 2 tick if inventory name of current inventory of player is "%arg-2%": set {_item} to yaml value "%arg 2%.item" from "plugins/Skript/scripts/jshop/worth.yml" set {_item} to {_item} parsed as item set {_worthbuy} to yaml value "%arg 2%.worth.buy" from "plugins/Skript/scripts/jshop/worth.yml" set {_worthsell} to yaml value "%arg 2%.worth.sell" from "plugins/Skript/scripts/jshop/worth.yml" set {_worthbuy} to {_worthbuy} parsed as integer set {_worthsell} to {_worthsell} parsed as integer format slot 1 of arg-player with 1 of {_item} named "&2&lKup" with lore "&aIlosc: &e1||&aCena: &e%{_worthbuy}%$" to run "sklep buy %arg 2% %player-arg% 1 %{_worthbuy}%" format slot 7 of arg-player with 1 of {_item} named "&c&lSprzedaj" with lore "&aIlosc: &e1||&aCena: &e%{_worthsell}%$" to run "sklep sell %arg 2% %player-arg% 1 %{_worthsell}%" if yaml value "%arg 2%.16" from "plugins/Skript/scripts/jshop/worth.yml" is true: set {_worthbuy16} to {_worthbuy}*16 set {_worthsell16} to {_worthsell}*16 format slot 2 of arg-player with 16 of {_item} named "&2&lKup" with lore "&aIlosc: &e16||&aCena: &e%{_worthbuy16}%$" to run "sklep buy %arg 2% %player-arg% 16 %{_worthbuy16}%" format slot 6 of arg-player with 16 of {_item} named "&c&lSprzedaj" with lore "&aIlosc: &e16||&aCena: &e%{_worthsell16}%$" to run "sklep sell %arg 2% %player-arg% 16 %{_worthsell16}%" if yaml value "%arg 2%.64" from "plugins/Skript/scripts/jshop/worth.yml" is true: set {_worthbuy64} to {_worthbuy}*64 set {_worthsell64} to {_worthsell}*64 format slot 3 of arg-player with 64 of {_item} named "&2&lKup" with lore "&aIlosc: &e64||&aCena: &e%{_worthbuy64}%$" to run "sklep buy %arg 2% %player-arg% 64 %{_worthbuy64}%" format slot 5 of arg-player with 64 of {_item} named "&c&lSprzedaj" with lore "&aIlosc: &e64||&aCena: &e%{_worthsell64}%$" to run "sklep sell %arg 2% %player-arg% 64 %{_worthsell64}%" if arg 1 is "buy": if sender is not console: stop if player-arg's money is more than arg 5: set {_item} to yaml value "%arg 2%.item" from "plugins/Skript/scripts/jshop/worth.yml" set {_item} to {_item} parsed as item if player-arg has enough space for 64 bedrock: subtract arg 5 from player-arg's money give arg 4 of {_item} to the player-arg send "{@tag} &aKupiles &e%arg 4% %arg 2% &aza &e%arg 5%$&a!" to player-arg else: send "{@tag} &e%arg 4% %arg 2% &cnie zmieści się w Twoim ekwipunku!" to player-arg else: send "{@tag} &cNie posiadasz &e%arg 5%$&c!" to player-arg if arg 1 is "sell": if sender is not console: stop set {_item} to yaml value "%arg 2%.item" from "plugins/Skript/scripts/jshop/worth.yml" set {_item} to {_item} parsed as item if player-arg has arg 4 of {_item}: add arg 5 to player-arg's money remove arg 4 of {_item} from the player-arg send "{@tag} &aSprzedałes &e%arg 4% %arg 2%&a zyskując &e%arg 5%$&a!" to player-arg else: send "{@tag} &cNie posiadasz &e%arg 4% %arg 2%&c!" to player-arg