function openGUI(p: player, skrzynia: text): set {_gui} to chest inventory with 5 rows named "&aLootbox" set slot (integers between 0 and 45) of {_gui} to gray stained glass pane named "&7-" set slot 4 of {_gui} to chest named "&cLootbox %{_skrzynia}%" set slot 20 of {_gui} to lime concrete named "&aTak" set slot 24 of {_gui} to red concrete named "&cNie" open {_gui} to {_p} function openLB(p: player, skrzynia: text): set {_lb} to chest inventory with 5 rows named "&2Lootbox | %{_skrzynia}%" set slot (integers between 0 and 45) of {_lb} to gray stained glass pane named "&7-" set slot 22 of {_lb} to chest named "&6Otwieranie w toku..." open {_lb} to {_p} wait 3 real seconds openLB1({_p}, {_skrzynia}) function openLB1(p: player, skrzynia: text): set {_x} to chest inventory with 5 rows named "&3Lootbox" set slot (integers between 0 and 45) of {_x} to gray stained glass pane named "&7-" loop {Itemki-%{_skrzynia}%::*}: if loop-value is not air: add loop-value to {_drop::*} set {_item} to random element out of {_drop::*} show 100 flame with speed 0.1 at {Lootchest-%{Lootlc}%-%{_zm}%} play sound "entity.experience_orb.pickup" with volume 0.5 at {Lootchest-%{Lootlc}%-%{_zm}%} set slot 22 of {_x} to {_item} named "&aWylosowano itemek!" give {_item} to {_p} open {_x} to {_p} function zmiennaLB1(p: player): on inventory click: if name of event-inventory is "&aLootbox": cancel event if event-inventory is not player's inventory: if clicked slot is integers between 0 and 45: cancel event if clicked slot is 4: cancel event if clicked slot is 20: set {_x} to name of slot 4 of current inventory of player set {_a::*} to split {_x} at " " set {_skrzynia} to uncolored {_a::2} remove 1 of {_lbx} from player cancel event send "&aPomyślnie otworzono lootbox'a!" openLB(player, {_skrzynia}) if clicked slot is 24: send "&cPomyślnie zanulowano otworzenie lottbox'a" close player's inventory if name of event-inventory contains "&2Lootbox": cancel event if event-inventory is not player's inventory: if clicked slot is integers between 0 and 45: cancel event if name of event-inventory is "&3Lootbox": cancel event command /lb [] []: permission: lb.adm permission message: &cNie możesz używać tej komendy! trigger: if arg 1 is set: if arg 1 is "daj": if arg 2 is not set: send "&cMusisz podać drugi argument!" else: give player arg 2 of chest named "&aLootbox" if arg 1 is "help": send "&6 ------------------------------------------------ " send "&6- /lb daj - daje lootboxa" send "&6- /lb help - pomoc dotycząca tego skryptu" send "&6- /ustawitemy - otwiera gui w którym można ustawić itemy" send "&6- /dropy - otwiera gui z dropami" send "&6- /ustawlb - ustawia skrzynke która ma być lootbox'em" send "&6- /dajklucz - daje klucze" send "&6- /usunitem - usuwa wszystkie itemy w lootbox'ie" send "&6- /tplb - teleportuje do lootbox'a" send "&6 ------------------------------------------------" else: send "&cMusisz podać prawidłowy argument! (/lb help)" command /ustawitemy []: permission: lb.adm permission message: &cNie masz do tego uprawnień! trigger: if arg 1 is not {namelb::%arg 1%}: send "&cPoprawne użycie: /ustawitemy " stop set {_x} to chest inventory with 6 rows named "&5Itemy" set slot 36 and 37 and 38 and 39 and 40 and 41 and 42 and 43 and 44 and 45 and 46 and 47 and 48 and 50 and 51 and 52 and 53 of {_x} to black stained glass pane named "&7" set slot 49 of {_x} to chest named "&aZapisz %arg-1%" with lore "&7Zapisz aktualnie inventory" set {_val} to 0 loop 36 times: set slot {_val} of {_x} to {Itemki-%arg 1%::%{_val}%} add 1 to {_val} open {_x} to player on inventory click: if name of event-inventory is "&5Itemy": if event-inventory is not player's inventory: if clicked item is black stained glass pane named "&7": cancel event if clicked slot is 49: cancel event set {_chest} to uncolored name of clicked slot set {_c1::*} to split {_chest} at " " set {_chestX} to {_c1::2} set {_x} to 0 loop 36 times: set {Itemki-%{_chestX}%::%{_x}%} to slot {_x} of current inventory of player add 1 to {_x} close player's inventory send "&aZapisano!" command /dropy []: trigger: if arg 1 is not "zwykla" or "epicka" or "legendarna": send "&cPoprawne użycie: /dropy " stop set {_x} to chest inventory with 4 rows named "&6Dropy" set {_val} to 0 loop 36 times: set slot {_val} of {_x} to {Itemki-%arg 1%::%{_val}%} add 1 to {_val} open {_x} for player on inventory click: if name of event-inventory is "&6Dropy": cancel event command /usunlb []: trigger: if arg 1 is set: if {namelb::%arg 1%} is arg 1: delete {namelb::%arg 1%} send "&aPomyślnie usunięto!" else: send "&cNie ma takiego lootbox'a!" else: send "&cPoprawne użycie /usunlb " command /stworzlb []: trigger: if arg 1 is set: if {namelb::%arg 1%} is arg 1: send "&cTaki lootbox już istnieje!" else: set {namelb::%arg 1%} to arg 1 set {klucz::%{namelb::%arg 1%}%} to glowing tripwire hook named arg 1 send "&aPomyślnie stworzony lootbox'a!" else: send "&cPoprawne użycie /stowrzlb " command /ustawlb []: permission: lb.adm permission message: &cNie masz do tego uprawnień! trigger: if arg 1 is not text: send "&cPoprawne użycie: /ustawlb " stop if targeted block is chest: if {namelb::%arg 1%} is set: set {Lootchest-%{Lootlc}%-%{_zm}%} to location at targeted block zmiennaLB1(player) send "&aPomyślnie ustawiono skrzynie!" else: send "&cMusisz stworzyć skrzynie pod komędą /lbstworz " else: send "&cNajedź na skrzynie!" on right click: if location at targeted block is {Lootchest-%{Lootlc}%-%{_zm}%}: cancel event if name of player's tool is name of {klucz::%{namelb::%random number between 1 and 1000%}%}: openGUI(player, "zwykla") else: send "&cNie masz potrzebnego klucza!" on left click: if location at targeted block is {Lootchest-%{Lootlc}%-%{namelb::321}%}: cancel event execute player command "dropy zwykla" command /dajklucz [] [] []: permission: lb.adm permission message: &cNie masz do tego uprawnień! trigger: if arg 1 is not text: send "&cPoprawne użycie: /dajklucz " stop if arg 1 is "all": if arg 2 is not set: send "&cMusisz podać ilość lootbox'ów!" else: if arg 3 is not set: send "&cMusisz podać nazwę lootbox'a!" else: give arg 2 of {_kl} named "{Lootchest-%{Lootlc}%-%{_zm}%}" to all players else: if arg 1 is set: if arg 1 is player: if arg 2 is set: if arg 3 is set: give arg 2 of {klucz::%{namelb::%arg 3%}%} to arg 1 parsed as player send "&aPomyślnie dano klucz/e!" else: send "&cMusisz podać trzeci argument! (Nazwa lootbox'a)" else: send "&cMusisz podać drugi argument! (Musi on być liczbą)" else: send "&cTen gracz nie jest online" else: send "&cPoprawne użycie: /dajklucz " command /usunitemy []: permission: lb.adm permission message: &cNie masz do tego uprawnień! trigger: if arg 1 is not "zwykla" or "epicka" or "legendarna": send "&cPoprawne użycie: /usunitemy " stop clear {Itemki-%arg-1%::*} send "&aPomyślnie usunięto itemy z dropu %arg-1%." command /tplb []: permission: lb.adm permission message: &cNie masz do tego uprawnień! trigger: if arg 1 is not "zwykla" or "epicka" or "legendarna": send "&cPoprawne użycie: /tplb " stop teleport player to {Lootchest-%arg-1%}