command /premiumcase [] []: permission: admin.premiumcase trigger: arg 1 is "daj": arg 2 is set: give argument 2 named "&9&lPREMIUMCASE" to player arg 1 is "all": arg 2 is set: loop all players: give 3 chest named "&9&lPREMIUMCASE" to loop-player broadcast "&9Kazdy otrzymal PREMIUMCASE'a!" arg 1 is "edytuj": open chest with 6 rows named "&9&lPREMIUMCASE" to player wait 1 tick set {_slot} to 0 set {premiumcase::%player%::edit} to true loop {pcase::itemlist::*}: set slot {_slot} of current inventory of player to loop-value add 1 to {_slot} on inventory close: if {premiumcase::%player%::edit} is true: loop 53 times: if slot "%loop-number -1%" parsed as an integer of current inventory of player is not air: set {_item} to slot loop-number - 1 of current inventory of player add {_item} to {pcase::itemlist::*} set {premiumcase::%player%::edit} to false send "&2Zapisano" on rightclick with chest: if name of player's tool is "&9&lPREMIUMCASE": set {_item1} to random element out of {pcase::itemlist::*} set {_item2} to random element out of {pcase::itemlist::*} set {_item3} to random element out of {pcase::itemlist::*} drop {_item1} at player drop {_item2} at player drop {_item3} at player send "&9&m-----------------------------------" send "&6Gracz %player% otworzyl premiumcase i wydropil:" send "&c- %{_item1}%" send "&c- %{_item2}%" send "&c- %{_item3}%" send "&9&m-----------------------------------" remove 1 chest named "&9&lPREMIUMCASE" from player on place: if player's tool is chest named "&9&lPREMIUMCASE": cancel event