on place: if player's tool is Chest named "&8[ &a&lSERWER CASE &8]": if player has 1 Tripwire Hook named "&8[ &6&lKLUCZ &8]": set event-block to chest named "&8[ &a&lSERWER CASE &8]" wait 3 second spawn 10 of particle smoke offset by 1, 1, 1 at event-block play raw sound "random.bow" at player with pitch 0.0 volume 10 clear {chest_} set {chest_} to 1 or 2 or 3 or 4 or 5 or 6 or 7 or 8 chance of 1%: set {chest_} to 0 if {chest_} is 1: drop 1 diamond helmet of protection 6 and unbreaking 3 broadcast "&8&l• &2%player% &7otworzyl &6&lSERWER CASE &7i wydropil &2Helm 6/3" remove 1 chest named "&8[ &a&lSERWER CASE &8]" from player stop if {chest_} is 2: drop 1 diamond chestplate of protection 6 and unbreaking 3 broadcast "&8&l• &2%player% &7otworzyl &6&lSERWER CASE &7i wydropil &2Klata 6/3" remove 1 chest named "&8[ &a&lSERWER CASE &8]" from player stop if {chest_} is 3: drop 1 diamond leggings of protection 6 and unbreaking 3 broadcast "&8&l• &2%player% &7otworzyl &6&lSERWER CASE &7i wydropil &2Spodnie 6/3" remove 1 chest named "&8[ &a&lSERWER CASE &8]" from player stop if {chest_} is 4: drop 1 diamond helmet of protection 6 and unbreaking 3 broadcast "&8&l• &2%player% &7otworzyl &6&lSERWER CASE &7i wydropil &2Buty 6/3" remove 1 chest named "&8[ &a&lSERWER CASE &8]" from player stop if {chest_} is 5: drop 1 diamond pickaxe of efficiency 5 and unbreaking 3 and fortune 3 broadcast "&8&l• &2%player% &7otworzyl &6&lSERWER CASE &7i wydropil &2Kilof 5/3/3" remove 1 chest named "&8[ &a&lSERWER CASE &8]" from player stop if {chest_} is 6: drop 3 enchanted golden apple broadcast "&8&l• &2%player% &7otworzyl &6&lSERWER CASE &7i wydropil &2x3 Koxy" remove 1 chest named "&8[ &a&lSERWER CASE &8]" from player stop if {chest_} is 7: drop 1 12 tnt broadcast "&8&l• &2%player% &7otworzyl &6&lSERWER CASE &7i wydropil &2x12 TnT" remove 1 chest named "&8[ &a&lSERWER CASE &8]" from player stop if {chest_} is 8: drop 12 ender pearl broadcast "&8&l• &2%player% &7otworzyl &6&lSERWER CASE &7i wydropil &2x12 ender perl" remove 1 chest named "&8[ &a&lSERWER CASE &8]" from player stop else: send "&8&l• &cNie masz klucza aby otworzyc ta skrzynie!" stop on place a tripwire hook: if player's tool is a tripwire hook named "&8[ &6&lKLUCZ &8]": cancel event send "&8&l• &cNie mozesz postawic klucza!" stop