on first join: set {osiagniecia.koxy.%player%} to 0 command /oskoxy1zab: trigger: set {osiagniecia.koxy.%player%} to 1 execute console command "give %player% golden_apple 10" command /os: trigger: open chest with 1 rows named "&bOsiagniecia" to player format slot 0 of player with golden apple:1 named "&cOsiagniecia: &eZjedzone Koxy" to close then run [player command "osiagnieciakoxy"] command /osiagnieciakoxy: trigger: wait 2 tick open chest with 1 rows named "&eZjedzone Koxy" to player wait 2 tick if {osiagniecia.koxy.%player%} is 0: format slot 0 of player with book named "&cOsiagniecia: &eZjedzone Koxy I" with lore "&7Status: &cZablokowane||&7Musisz zjesc 5 koxow" to be unstealable else: format slot 0 of player with book named "&cOsiagniecia: &eZjedzone Koxy I" with lore "&7Status: &aOdblokowane||&7Kliknij, aby dostac nagrode" to close then run [player command "oskoxy1zab"] every 1 second: loop all players: if {omnihc::koxy::%loop-player%} >= 5: set {osiagniecia.koxy.%loop-player%} to 1 stop