command /bazar [] []: trigger: if arg 1 is not set: open chest with 1 rows named "&aBazar" to player wait 2 tick format slot 0 of player with 1 of green wool named "&aSkup" to close then run [execute player command "bazar skup"] format slot 1 of player with 1 of ref wool named "&cSklep" to close then run [execute player command "bazar sklep"] format slot 8 of player with 8 of paper named "" with lore "&aW portfelu posiadasz: %balance of player%" if arg 1 is "Sklep": wait 2 tick open chest with 1 rows named "&cSklep" to player wait 2 tick format slot 0 of player with 1 diamond named "&9Diament" with lore " &6Koszt: &720$" to run [execute player command "bazar sklep diamond"] format slot 8 of player with 8 of paper named "" with lore "&aW portfelu posiadasz: %balance of player%" if arg 2 is "diamond": if balance of player's is bigger than 19: remove 20 from balance of player's send "&6Kupiles &c1 &9Diament" if player can hold 1 diamond: add 1 diamond to player's inventory else: drop 1 diamond if arg 1 is "Skup": wait 2 tick open chest with 1 rows named "&cSkup" to player wait 2 tick format slot 0 of player with 1 diamond named "&9Diament" with lore " &6Dostaniesz: &710$" to run [execute player command "bazar skup diamond"] format slot 8 of player with 8 of paper named "" with lore "&aW portfelu posiadasz: %balance of player%" if arg 2 is "diamond": if player has 1 diamond: add 20 to balance of player's send "&6Sprzedales &c1 &9Diament" remove 1 diamond from player