function Sejf_Wczyt(p: player, id: number): open chest with 6 rows named "&6Sejf: &c%{_id}%" to {_p} loop {sejf::%{_id}%::*}: wait 0.1 tick set {_p}'s current inventory's slot ((loop-index) parsed as integer) to loop-value send "&9Wczytano Sejf." to {_p} set {ot.%{_p}%} to true function Sejf_Zapis(p: player, id: number): loop 6*9 times: set {Sejf::%{_id}%::%((loop-number)-1)%} to {_p}'s current inventory's slot ((loop-number)-1) if {_p} can hold {toole::%{_p}%}: add {toole::%{_p}%} to {_p} else: add {toole::%{_p}%} to {_p} set {ot.%{_p}%} to false clear {toole::%{_p}%} send "&9Zapisano Sejf" to {_p} on inventory close: if inventory name of player's current inventory contains "&6Sejf: ": set {_nazwa} to uncolored inventory name of player's current inventory replace all "Sejf:" and " " with "" in {_nazwa} Sejf_Zapis(player, {_nazwa} parsed as number) on place: if player's tool is chest: if name of player's tool contains "&6Sejf: ": cancel event if player is not sneaking: if lore of player's tool is "&cWlasnosc: &6%player%": set {_nazwa} to uncolored name of player's tool set {toole::%player%} to player's tool remove player's tool from player replace all "Sejf:" and " " with "" in {_nazwa} Sejf_Wczyt(player, {_nazwa} parsed as number) else: if player has stick named "&6Lom" with lore "&cPotrzebujesz tego aby przywlaszczyc sejf!": open chest with 3 rows named "&6Lom" to player wait 1 tick loop 27 times: set player's current inventory's slot ((loop-number)-1) to ("101" parsed as item) named "" set player's current inventory's slot 13 to light green wool named "&6Potwierdz" with lore "&cKliknij aby potwierdzic zmiane wlasciciela" stop else: send "&6Aby otworzyc sejf potrzebujesz lomu!" on inventory click: if inventory name of player's current inventory is "&6Lom": cancel event if clicked slot is 13: remove 1 stick named "&6Lom" with lore "&cPotrzebujesz tego aby przywlaszczyc sejf!" from player set lore of player's tool to "&cWlasnosc: &6%player%" close player's inventory on drop: if {ot.%player%} is true: cancel event send "&6Nie mozesz wyrzucac itemow przy otwartym sejfie!" to player on first join: if {id} is not set: set {id} to 0 else: add 1 to {id} add 1 chest named "&6Sejf: %{id}%" with lore "&cWlasnosc: &6%player%" to player command /sejf []: trigger: if {id} is not set: set {id} to 0 else: add 1 to {id} if arg 1 is not set: set {_p} to player else: set {_p} to arg 1 add chest named "&6Sejf: %{id}%" to {_p} add stick named "&6Lom" with lore "&cPotrzebujesz tego aby przywlaszczyc sejf!" to {_p}