options: {buytnt} = 48 #przyklad {buychleb} = 16 #(przyklad) {buyskrzynia} = 32 #(przyklad) {buyksiazka} = 24 #(przyklad) {prefixgui} = &e&lSklep #(przyklad) command /ity []: trigger: if arg 1 is not set: open chest with 2 rows named "%{@prefixgui}%" to player wait 2 tick format slot 0 of player with 1 of tnt named "&aKup &ctnt" with lore "&eKoszt: &b%{@buytnt}% emeraldow" to close then run [execute player command "/ity tnt"] format slot 1 of player with 1 of bread named "&aKup Chleb" with lore "&eKoszt: &b%{@buychleb}% emeraldow" to close then run [execute player command "/ity chleb"] format slot 2 of player with 1 of chest named "&aKup skrzynia" with lore "&eKoszt: &b%{@buyskrzynia}% emeraldow" to close then run [execute player command "/ity skrzynia"] format slot 3 of player with 1 of book named "&aKup ksiazka" with lore "&eKoszt: &b%{@buyksiazka}% emeraldow" to close then run [execute player command "/ity ksiazka"] if arg 1 is "tnt": if player has {@buytnt} emerald: add 64 tnt to players inventory remove {@buytnt} emerald from player else: send "&cNie masz tylu emeraldow!" if arg 1 is "chleb": if player has {@buychleb} emerald: add 64 tnt to players inventory remove {@buychleb} emerald from player else: send "&cNie masz tylu emeraldow!" if arg 1 is "skrzynia": if player has {@buyskrzynia} emerald: add 64 chest to players inventory remove {@buyskrzynia} emerald from player else: send "&cNie masz tylu emeraldow!" if arg 1 is "ksiazka": if player has {@buyksiazka} emerald: add 64 book to players inventory remove {@buyksiazka} emerald from player else: send "&cNie masz tylu emeraldow!"