function gui1(p: player): set {_} to chest inventory with 3 rows named "Gui" set slot (integers between 0 and 27) of {_} to black stained glass pane set slot 12 of {_} to red wool named "&cWeź pocztówki" set slot 13 of {_} to sunflower named "&6Obierz nagrodę" with lore "&6Aby odebrać nagrode dostarcz 7 pocztówek" and "&6Dostarczyłeś %{dost::%{_p}%}%/7 pocztówek" if {pocztk::%{_p}%::*} is not set: set slot 14 of {_} to map named "&2Lokacje pocztówek" with lore "&2Brak" else: set slot 14 of {_} to map named "&2Lokacje pocztówek" set {_m} to 0 loop 7 times: add 1 to {_m} if {pocztk::%{_p}%::%{_m}%} is not set: set line {_m} of lore of slot 14 of {_} to "%{_m}%. &aWykonane" else: set {_x::1} to x-loc of {pocztk::%{_p}%::%{_m}%} set {_x::2} to y-loc of {pocztk::%{_p}%::%{_m}%} set {_x::3} to z-loc of {pocztk::%{_p}%::%{_m}%} set line {_m} of lore of slot 14 of {_} to "%{_m}%. &ax: %{_x::1}% y: %{_x::2}% z: %{_x::3}%" clear {_x::*} set slot 22 of {_} to barrier named "&cZrezygnuj" with lore "&cWcisnij aby zrezygnowac z dostarczenia pocztówki" open {_} to {_p} on right click: name of clicked entity is "SZEF" gui1(player) on tab complete of "/configpoczta": set tab completions for position 1 to "dodaj", "reset" and "lista" on inventory click: event-inventory is not player's inventory if name of event-inventory is "Gui": cancel event if clicked slot is 12: if {dost::%player%} >= 7: send "&cDostarczyłeś już 7 pocztówek! Idź odebrać nagrodę" else: if {pocztk::%player%::*} is not set: set {_a::*} to {kordyskrzynie::*} loop 7 times: set {_b} to random element of {_a::*} remove {_b} from {_a::*} add {_b} to {pocztk::%player%::*} clear {_b} send "&6Wziąłeś zlecenie na pocztówkę" close player's inventory gui1(player) else: send "&cMasz już zlecenie na pocztówkę!" close player's inventory if clicked slot is 13: if {dost::%player%} >= 7: set {dost::%player%} to 0 set {_} to random integer between 100 and 120 add {_} to balance of player send "&2Otrzymałeś %{_}%$!" close player's inventory gui1(player) else: send "&6Nie dostarczyłeś 7 pocztówek!" if clicked slot is 22: delete {pocztk::%player%::*} send "&cZrezygnowałeś z pocztówek" close player's inventory gui1(player) if name of event-inventory is "&aPocztowki": cancel event variables: {dost::%player%} = 0 on right click: {pocztk::%player%::*} contains location of clicked block remove location of clicked block from {pocztk::%player%::*} add 1 to {dost::%player%} send "&cDostarczono pocztówkę" stop command /configpoczta []: permission: op permission message: &cGdzie z łapami trigger: if arg 1 is not set: send "&bKomendy:%nl%&f-&3/configpoczta dodaj &f- dodaje blok pod wpisującym do listy pocztowek%nl%&f-&3/configpoczta reset &f-usuwa wszystkie dane zwiazane ze skryptem%nl%&f-&3/configpoczta reset &f- wyswietla liste lokacji poczt" if arg 1 is "dodaj": loop {kordyskrzynie::*}: loop-value is location of block 0.3 meters below player send "&cTen blok jest już dodany!" stop add location of block 0.3 meters below player to {kordyskrzynie::*} send "&cDodano blok" if arg 1 is "reset": delete {kordyskrzynie::*} delete {pocztk::*} set {dost::%player%} to 0 if arg 1 is "lista": send {kordyskrzynie::*} command /pocztowki: trigger: set {_p} to player set {_} to chest inventory with 1 row named "&aPocztowki" set slot (integers between 0 and 9) of {_} to black stained glass pane if {pocztk::%{_p}%::*} is not set: set slot 4 of {_} to map named "&2Lokacje pocztówek" with lore "&2Brak" else: set slot 4 of {_} to map named "&2Lokacje pocztówek" set {_m} to 0 loop 7 times: add 1 to {_m} if {pocztk::%{_p}%::%{_m}%} is not set: set line {_m} of lore of slot 4 of {_} to "%{_m}%. &aWykonane" else: set {_x::1} to x-loc of {pocztk::%{_p}%::%{_m}%} set {_x::2} to y-loc of {pocztk::%{_p}%::%{_m}%} set {_x::3} to z-loc of {pocztk::%{_p}%::%{_m}%} set line {_m} of lore of slot 4 of {_} to "%{_m}%. &ax: %{_x::1}% y: %{_x::2}% z: %{_x::3}%" clear {_x::*} open {_} to player