function OpenLb(p: player, skrzynia: text): set {_gui} to chest inventory with 5 rows named "&aLootbox" set slot 13 of {_gui} to chest named "&aSkrzynia &6%{_skrzynia}%" with lore "&7Jezeli chcesz sprawdzic co" and "&7mozesz otrzymac, wpisz &3/drop %{_skrzynia}%" and "" and "&7Rodzaj: &6%{_skrzynia}%" set slot 29 of {_gui} to lime concrete named "&aTak" with lore "&7Jezeli chcesz otworzyc LootBoxa," and "&7kliknij w to miejsce!" and "" and "&7Rodzaj: &6%{_skrzynia}%" and "" and "&eKliknij, aby otworzyć!" set slot 33 of {_gui} to red concrete named "&cNie" with lore "&7Jezeli nie chcesz otwierac" and "&7LootBoxa, kliknij tutaj." and "" and "&eKliknij, aby anulowac!" open {_gui} to {_p} function StartOpen(p: player, skrzynia: text): loop {dropy-%{_skrzynia}%::*}: if loop-value is not air: add loop-value to {_dropy::*} set {_wait} to 1.3 tick set {_LoopIndex} to 0 if {Animacja::%{_skrzynia}%} is 1: set {_itemek} to LosujRarity("%{_skrzynia}%") if {Animacja::%{_skrzynia}%} is 2: loop 32 times: set {_itemR} to LosujRarity("%{_skrzynia}%") add 1 to {_LoopIndex} set {_lb} to chest inventory with 1 rows named "&6Losowanie &8| &b%{_skrzynia}%" set {_aX} to 0 loop 8 times: set slot {_aX} of {_lb} to grey stained glass pane named "&7Trwa losowanie..." if {_aX} is 3: add 1 to {_aX} add 1 to {_aX} set {_lore::*} to lore of {_itemR} set slot 4 of {_lb} to {_itemR} with lore "&7Trwa losowanie przedmiotu," and "&7który otrzymasz!" and "" and {_lore::*} open {_lb} for {_p} if Wait({_LoopIndex}) is set: set {_wait} to Wait({_LoopIndex}) set {_wait} to "%{_wait}% ticks" parsed as timespan wait {_wait} replace all "&7Trwa losowanie przedmiotu," and "&7który otrzymasz!%nl%" with "" in lore of {_itemR} set {_itemek} to {_itemR} if {Animacja::%{_skrzynia}%} is 3: loop 32 times: add 1 to {_LoopIndex} set {_lb} to chest inventory with 3 rows named "&6Losowanie &8| &b%{_skrzynia}%" if {_LoopIndex} is 1: set {_SlotX} to 8 loop 9 times: add 1 to {_SlotX} set {_re} to LosujRarity("%{_skrzynia}%") set slot {_SlotX} of {_lb} to {_re} set {_TempSlot-%{_SlotX}%} to {_re} else: set {_SlotX} to 8 loop 9 times: add 1 to {_SlotX} set slot {_SlotX} of {_lb} to {_TempSlot-%{_SlotX}+1%} set {_TempSlot-%{_SlotX}%} to {_TempSlot-%{_SlotX}+1%} set {_re} to LosujRarity("%{_skrzynia}%") set slot 17 of {_lb} to {_re} set {_TempSlot-17} to {_re} set slot (integers between 0 and 8) and (integers between 18 and 26) of {_lb} to gray stained glass pane named "&7" set slot 4 and 22 of {_lb} to lime stained glass pane named "&7" open {_lb} for {_p} if Wait({_LoopIndex}) is set: set {_wait} to Wait({_LoopIndex}) set {_wait} to "%{_wait}% ticks" parsed as timespan wait {_wait} set {_itemek} to {_TempSlot-13} if {Animacja::%{_skrzynia}%} is 4: loop 32 times: add 1 to {_LoopIndex} set {_lb} to chest inventory with 3 rows named "&6Losowanie &8| &b%{_skrzynia}%" if {_LoopIndex} is 1: set {_SlotX} to 18 loop 9 times: remove 1 from {_SlotX} set {_re} to LosujRarity("%{_skrzynia}%") set slot {_SlotX} of {_lb} to {_re} set {_TempSlot-%{_SlotX}%} to {_re} else: set {_SlotX} to 18 loop 9 times: remove 1 from {_SlotX} if loop-value-2 is 4: set slot {_SlotX} of {_lb} to {_TempSlot-%{_SlotX}-1%} else: set slot {_SlotX} of {_lb} to {_TempSlot-%{_SlotX}-1%} set {_TempSlot-%{_SlotX}%} to {_TempSlot-%{_SlotX}-1%} set {_re} to LosujRarity("%{_skrzynia}%") set slot 8 of {_lb} to {_re} set {_TempSlot-8} to {_re} set slot (integers between 0 and 8) and (integers between 18 and 26) of {_lb} to gray stained glass pane named "&7" set slot 4 and 22 of {_lb} to lime stained glass pane named "&7" open {_lb} for {_p} if Wait({_LoopIndex}) is set: set {_wait} to Wait({_LoopIndex}) set {_wait} to "%{_wait}% ticks" parsed as timespan wait {_wait} set {_itemek} to {_TempSlot-13} if {Animacja::%{_skrzynia}%} is 6: loop 33 times: add 1 to {_LoopIndex} set {_lb} to chest inventory with 6 rows named "&6Losowanie &8| &b%{_skrzynia}%" if {_LoopIndex} is 1: set {_SlotX} to 37 loop 19 times: set {_SlotX} to GetSlotSpinning({_SlotX}) set {_re} to LosujRarity("%{_skrzynia}%") set {_TempSlot-%{_SlotX}%} to {_re} set slot {_SlotX} of {_lb} to {_re} else: set {_SlotX} to 37 loop 19 times: set {_SlotX} to GetSlotSpinning({_SlotX}) set {_getSlotx2} to GetSlotSpinning({_SlotX}) set {_TempSlot-%{_SlotX}%} to {_TempSlot-%{_getSlotx2}%} set slot {_SlotX} of {_lb} to {_TempSlot-%{_getSlotx2}%} set slot 4 and 22 of {_lb} to lime stained glass pane named "&7" open {_lb} for {_p} if Wait({_LoopIndex}) is set: set {_wait} to Wait({_LoopIndex}) set {_wait} to "%{_wait}% ticks" parsed as timespan wait {_wait} set {_itemek} to {_TempSlot-13} if {Animacja::%{_skrzynia}%} is 7: loop 32 times: add 1 to {_LoopIndex} set {_lb} to chest inventory with 6 rows named "&6Losowanie &8| &b%{_skrzynia}%" if {_LoopIndex} is 1: set {_SlotX::1} to 3-9 set {_SlotX::2} to 4-9 set {_SlotX::3} to 5-9 loop 37 times: add 9 to {_SlotX::1} add 9 to {_SlotX::2} add 9 to {_SlotX::3} set {_re::1} to LosujRarity("%{_skrzynia}%") set {_re::2} to LosujRarity("%{_skrzynia}%") set {_re::3} to LosujRarity("%{_skrzynia}%") set slot {_SlotX::1} of {_lb} to {_re::1} set slot {_SlotX::2} of {_lb} to {_re::2} set slot {_SlotX::3} of {_lb} to {_re::3} set {_TempSlot-%{_SlotX::1}%} to {_re::1} set {_TempSlot-%{_SlotX::2}%} to {_re::2} set {_TempSlot-%{_SlotX::3}%} to {_re::3} else: set {_SlotX::1} to 3-9 set {_SlotX::2} to 4-9 set {_SlotX::3} to 5-9 loop 37 times: add 9 to {_SlotX::1} add 9 to {_SlotX::2} add 9 to {_SlotX::3} set slot {_SlotX::1} of {_lb} to {_TempSlot-%{_SlotX::1}+9%} set slot {_SlotX::2} of {_lb} to {_TempSlot-%{_SlotX::2}+9%} set slot {_SlotX::3} of {_lb} to {_TempSlot-%{_SlotX::3}+9%} set {_TempSlot-%{_SlotX::1}%} to {_TempSlot-%{_SlotX::1}+9%} set {_TempSlot-%{_SlotX::2}%} to {_TempSlot-%{_SlotX::2}+9%} set {_TempSlot-%{_SlotX::3}%} to {_TempSlot-%{_SlotX::3}+9%} set slot 27, 28, 29, 33, 34, 35 of {_lb} to lime stained glass pane named "&a" open {_lb} for {_p} if Wait({_LoopIndex}) is set: set {_wait} to Wait({_LoopIndex}) set {_wait} to "%{_wait}% ticks" parsed as timespan wait {_wait} set {_itemek::1} to {_TempSlot-30} set {_itemek::2} to {_TempSlot-31} set {_itemek::3} to {_TempSlot-32} EndCasinoOpen({_p}, {_skrzynia}, {_itemek::*}) stop if {Animacja::%{_skrzynia}%} is 5: loop 32 times: add 1 to {_LoopIndex} set {_lb} to chest inventory with 6 rows named "&6Losowanie &8| &b%{_skrzynia}%" set slot (integers between 0 and 53) of {_lb} to gray stained glass pane named "&7" if {_LoopIndex} is 1: set {_SlotX} to 58 loop 6 times: remove 9 from {_SlotX} set {_re} to LosujRarity("%{_skrzynia}%") set slot {_SlotX} of {_lb} to {_re} set {_TempSlot-%{_SlotX}%} to {_re} else: set {_SlotX} to 58 loop 6 times: remove 9 from {_SlotX} set slot {_SlotX} of {_lb} to {_TempSlot-%{_SlotX}-9%} set {_TempSlot-%{_SlotX}%} to {_TempSlot-%{_SlotX}-9%} set {_re} to LosujRarity("%{_skrzynia}%") set slot 4 of {_lb} to {_re} set {_TempSlot-4} to {_re} set slot 27, 28, 29, 30, 32, 33, 34, 35 of {_lb} to lime stained glass pane named "&7" open {_lb} for {_p} if Wait({_LoopIndex}) is set: set {_wait} to Wait({_LoopIndex}) set {_wait} to "%{_wait}% ticks" parsed as timespan wait {_wait} set {_itemek} to {_TempSlot-31} if {Animacja::%{_skrzynia}%} is 8: loop 32 times: add 1 to {_LoopIndex} set {_lb} to chest inventory with 6 rows named "&6Losowanie &8| &b%{_skrzynia}%" if {_LoopIndex} is 1: set {_SlotX} to 35 loop 21 times: set {_SlotX} to GetSlotSnake({_SlotX}) set {_re} to LosujRarity("%{_skrzynia}%") set slot {_SlotX} of {_lb} to {_re} set {_TempSlot-%{_SlotX}%} to {_re} else: set {_SlotX} to 35 loop 21 times: set {_SlotX} to GetSlotSnake({_SlotX}) set {_GetSlotX} to GetSlotSnake({_SlotX}) set slot {_SlotX} of {_lb} to {_TempSlot-%{_GetSlotX}%} set {_TempSlot-%{_SlotX}%} to {_TempSlot-%{_GetSlotX}%} set {_re} to LosujRarity("%{_skrzynia}%") set slot 44 of {_lb} to {_re} set {_TempSlot-44} to {_re} set slot 27 and 45 of {_lb} to lime stained glass pane named "&7" open {_lb} for {_p} if Wait({_LoopIndex}) is set: set {_wait} to Wait({_LoopIndex}) set {_wait} to "%{_wait}% ticks" parsed as timespan wait {_wait} set {_itemek} to {_TempSlot-36} EndOpen({_p}, {_skrzynia}, {_itemek}, true) function GetSlotSpinning(slot: number) :: number: if {_slot} is not 43 or 42 or 41 or 40 or 39 or 38 or 16 or 25 or 34 or 37 or 28 or 19: if {_slot} is 10 or 11 or 12 or 13 or 14 or 15: add 1 to {_slot} else if {_slot} is 43 or 42 or 41 or 40 or 39 or 38: remove 1 from {_slot} else if {_slot} is 16 or 25 or 34: add 9 to {_slot} else if {_slot} is 37 or 28 or 19: remove 9 from {_slot} return {_slot} function GetSlotSnake(slot: number) :: number: if {_slot} is 35 or 36 or 10 or 11 or 39 or 40 or 14 or 15 or 43: add 1 to {_slot} else if {_slot} is 37 or 28 or 19 or 41 or 32 or 23: remove 9 from {_slot} else if {_slot} is 21 or 30 or 25 or 34 or 12 or 16: add 9 to {_slot} return {_slot} function EndCasinoOpen(p: player, skrzynia: text, itemki: objects): set {_x} to chest inventory with 1 rows named "&aWylosowano!" set slot (integers between 0 and 8) of {_x} to lime stained glass pane named "&a" if {_itemki::1} = {_itemki::2} and {_itemki::3}: set {_wygrana} to true loop {_itemki::*}: set {_i} to 2 + loop-index parsed as number if {_wygrana} is true: set {_glowing} to loop-value enchant {_glowing} with unbreaking 10 else: set {_glowing} to loop-value set slot {_i} of {_x} to {_glowing} open {_x} to {_p} if {_wygrana} is true: show 200 flame with speed 0.2 at {loclb::%{_skrzynia}%} loop {_itemki::*}: if {_p} have enough space for loop-value: give loop-value to {_p} else: drop loop-value at location of {_p} send "" to all players send "&7Gracz &a%{_p}%&7 wydropił &a%{_itemek}%x3 &7ze skrzyni: &a%{_skrzynia}% w trybie KASYNO!" to all players send "" to all players else: send "&cNiestety nie udało ci się niczego wygrać!" to {_p} function EndOpen(p: player, skrzynia: text, itemek: item, true: boolean): if {_true} is true: set {_x} to chest inventory with 1 rows named "&aWylosowano!" set slot (integers between 0 and 8) of {_x} to lime stained glass pane of unbreaking 10 named "&7" show 100 flame with speed 0.1 at {loclb::%{_skrzynia}%} set slot 4 of {_x} to {_itemek} named "&aWylosowano itemek!" with lore "&7Ten itemek zostal wylosowany" and "&7z twojej skrzynki!" and "" and "&eGratulacje!" open {_x} to {_p} send "" to all players send "&7Gracz &a%{_p}%&7 wydropił &a%{_itemek}% &7ze skrzyni: &a%{_skrzynia}%" to all players send "" to all players if {_p} have enough space for {_itemek}: give {_itemek} to {_p} else: drop {_itemek} at location of {_p} on inventory click: if name of event-inventory contains "&6Losowanie": cancel event if name of event-inventory is "&aWylosowano!": cancel event if name of event-inventory is "&aLootbox": cancel event if clicked slot is 29: set {_x} to name of slot 13 of current inventory of player set {_a::*} to split {_x} at " " set {_skrzynia} to uncolored {_a::2} remove 1 of tripwire hook of unbreaking 10 named "&aKlucz &6%{_skrzynia}%" with lore "&7Tym kluczem możesz otworzyć" and "&7LootBoxa &3%{_skrzynia}%&7!" and "" and "&eKliknij, aby otworzyć!" from player cancel event send "&aRozpoczeto otwieranie!" StartOpen(player, {_skrzynia}) if clicked slot is 33: close player's inventory send "&cAnulowano!" command /lb [] []: permission: lb.adm permission message: &cNie możesz używać tej komendy! aliases: lootbox trigger: if arg-1 and arg-2 is not set: EditMenu(player) else: if arg-1 is "delete" or "usun" or "usuń": if arg-2 is not set: send "&cPodaj nazwe skrzynki!" stop else: if {chesty::*} contains arg-2: send "&aUsunieto!" remove arg-2 from {chesty::*} else: send "&cTaka skrzynia nie istnieje!" if arg-1 is "stworz" or "stwórz": if arg-2 is not set: send "&cPodaj nazwe skrzynki!" stop else: if {chesty::*} contains arg-2: send "&cTaka skrzynia juz istnieje!" else: send "&aStworzono!" add arg-2 to {chesty::*} function EditMenu(player: player): set {_x} to chest inventory with 5 rows named "&8LootBoxy" set slot (integers between 27 and 39) of {_x} to gray stained glass pane named "&7" set slot (integers between 41 and 44) of {_x} to gray stained glass pane named "&7" set slot 40 of {_x} to lime concrete named "&aStwórz LootBoxa" with lore "" and "&7Stwórz nowego LootBoxa, aby" and "&7gracze mieli co otwierać!" and "" and "&eKliknij, aby stworzyć!" loop {chesty::*}: add chest named "&eLootBox &6%loop-value%" with lore "&8ID: %loop-value%" and "" and "&7Jezeli chcesz zedytowac tego" and "&7LootBoxa, kliknij tutaj!" and "" and "&eKliknij, aby edytowac!" to {_x} open {_x} for {_player} on inventory click: if name of event-inventory is "&8LootBoxy": cancel event if clicked slot is chest: set {_x::*} to uncolored lore of clicked slot set {_chest} to {_x::1} replace all "ID: " with "" in {_chest} EditChest(player, {_chest}) if clicked slot is 40: close player's inventory send "&6&m " send "" send "&6&lStwórz LootBoxa" to player send "" send "&eAby stworzyć, użyj:" to player send "&b/lb stworz [nazwa]" to player send "" send "&6&m " if name of event-inventory contains "&8Edycja": set {_chest} to uncolored name of current inventory of player replace all "Edycja: " with "" in {_chest} cancel event if clicked slot is 40: if {Animacja::%{_chest}%} is 1: set {Animacja::%{_chest}%} to 2 else if {Animacja::%{_chest}%} is 2: set {Animacja::%{_chest}%} to 3 else if {Animacja::%{_chest}%} is 3: set {Animacja::%{_chest}%} to 4 else if {Animacja::%{_chest}%} is 4: set {Animacja::%{_chest}%} to 5 else if {Animacja::%{_chest}%} is 5: set {Animacja::%{_chest}%} to 6 else if {Animacja::%{_chest}%} is 6: set {Animacja::%{_chest}%} to 7 else if {Animacja::%{_chest}%} is 7: set {Animacja::%{_chest}%} to 8 else if {Animacja::%{_chest}%} is 8: set {Animacja::%{_chest}%} to 1 send action bar "&aZmieniono!" EditChest(player, {_chest}) if clicked slot is 28: show 100 flame with speed 0.1 at {loclb::%{_chest}%} remove {_chest} from {chesty::*} clear {dropy-%{_chest}%::*} delete {loclb::%{_chest}%} send "&aPomyślnie usunięto!" EditMenu(player) if clicked slot is 29: close player's inventory if {loclb::%{_chest}%} is not set: send "&cLokalizacja nie jest ustawiona!" stop teleport player to {loclb::%{_chest}%} send "&aPrzeteleportowano!" if clicked slot is 31: EditItems(player, {_chest}) if clicked slot is 33: set {_x} to chest inventory with 4 rows named "&8Klucze: %{_chest}%" set slot 12 of {_x} to tripwire hook of unbreaking 10 named "&aDaj klucz sobie" with lore "&7Jezeli chcesz dac klucze" and "&7tylko sobie, kliknij tutaj!" and "" and "&7Skrzynia: &6%{_chest}%" and "" and "&eKliknij, aby otrzymac!" set slot 14 of {_x} to tripwire hook of unbreaking 10 named "&aRozdaj klucze wszystkim" with lore "&7Jezeli chcesz rozdac klucze" and "&7kazdemu, kliknij tutaj!" and "" and "&7Skrzynia: &6%{_chest}%" and "" and "&eKliknij, aby rozdac!" set slot 31 of {_x} to arrow named "&cPowrót" with lore "&8ID: %{_chest}%" and "" and "&7Powrót do menu!" and "" and "&eKliknij, aby powrócić!" open {_x} for player if clicked slot is 34: close player's inventory set {_pitch} to 0.7 loop 30 times: show 3 end rod with speed 0.05 at targeted block show 3 flame with speed 0.05 at targeted block if loop-value is 1: send "&aUstawianie... &7(3s)" if loop-value is 10: send "&aUstawianie... &7(2s)" if loop-value is 20: send "&aUstawianie... &7(1s)" add 0.05 to {_pitch} wait 0.1 second loop {chesty::*}: if {loclb::%loop-value%} is targeted block: send "&cTen blok jest już ustawiony dla skrzynki! &7(%loop-value%)" EditChest(player, {_chest}) stop set {loclb::%{_chest}%} to targeted block show 100 dragon breath with speed 0.2 at targeted block send "&aPomyslnie ustawiono!" EditChest(player, {_chest}) if name of event-inventory contains "&8Klucze": set {_chest} to uncolored name of current inventory of player replace all "Klucze: " with "" in {_chest} cancel event if clicked slot is 31: EditChest(player, {_chest}) if clicked slot is 12: give tripwire hook of unbreaking 10 named "&aKlucz &6%{_chest}%" with lore "&7Tym kluczem możesz otworzyć" and "&7LootBoxa &3%{_chest}%&7!" and "" and "&eKliknij, aby otworzyć!" to player send "&aOtrzymano!" if clicked slot is 14: give tripwire hook of unbreaking 10 named "&aKlucz &6%{_chest}%" with lore "&7Tym kluczem możesz otworzyć" and "&7LootBoxa &3%{_chest}%&7!" and "" and "&eKliknij, aby otworzyć!" to all players send "&aRozdano!" function EditItems(player: player, chest: text): set {_x} to chest inventory with 6 rows named "&8Itemy" 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 gray stained glass pane named "&7" set slot 49 of {_x} to chest named "&aZapisz &6%{_chest}%" with lore "&7Jezeli skonczyles ukladac" and "&7przedmioty, zapisz inventory!" and "" and "&eKliknij, aby zapisac!" set {_val} to 0 loop 36 times: set {_lore::*} to lore of {dropy-%{_chest}%::%{_val}%} add "" to {_lore::*} add "&7Szansa:" to {_lore::*} add " &3- &e%{szanse-%{_chest}%::%{_val}%} ? "???"% %%" to {_lore::*} add "" to {_lore::*} add "&7Shift + Lewy, aby &adodać 0.5%%" to {_lore::*} add "&7Shift + Prawy, aby &aodjąć 0.5%%" to {_lore::*} set slot {_val} of {_x} to {dropy-%{_chest}%::%{_val}%} with lore {_lore::*} add 1 to {_val} open {_x} to {_player} function EditChest(player: player, chest: text): set {_x} to chest inventory with 6 rows named "&8Edycja: %{_chest}%" set slot 13 of {_x} to chest named "&eEdycja &6%{_chest}%" with lore "&7Aktualnie edytujesz LootBoxa" and "&7z nazwa %{_chest}%" set slot 28 of {_x} to red concrete named "&cUsun" with lore "&7Jezeli chcesz usunac tego" and "&7LootBoxa, kliknij tutaj!" and "" and "&eKliknij, aby usunac!" set slot 29 of {_x} to end portal frame named "&aTeleportacja" with lore "&7Jezeli chcesz zobaczec lokalizacje" and "&7LootBoxa, kliknij tutaj!" and "" and "&eKliknij, aby przeteleportowac!" set slot 31 of {_x} to emerald named "&aUstaw itemki" with lore "&7Ustaw przedmioty, które moga" and "&7wypasc otwierajac LootBoxa!" and "" and "&eKliknij, aby ustawic!" set slot 33 of {_x} to tripwire hook of unbreaking 10 named "&aKlucze" with lore "&7Jezeli chcesz otrzymac lub" and "&7rozdac klucze, kliknij tutaj!" and "" and "&eKliknij, aby wybrac!" set slot 34 of {_x} to chorus fruit block named "&aLokalizacja" with lore "&7Ustaw lokalizacje LootBoxa na" and "&7blok, na który się patrzysz!" and "" and "&eKliknij, aby ustawic!" if slot 40 of {_x} is not set: set slot 40 of {_x} to barrier named "&8Animacja: &cBRAK" with lore "&7Kliknij aby zmienić!" if {Animacja::%{_chest}%} is not set: set {_a1} to minecart set {_a2} to "&dBrak &8(&a1&8)" set {Animacja::%{_chest}%} to 1 if {Animacja::%{_chest}%} is 1: set {_a1} to minecart set {_a2} to "&dBrak &8(&a1&8)" if {Animacja::%{_chest}%} is 2: set {_a1} to rail set {_a2} to "&dZwykla &8(&a2&8)" if {Animacja::%{_chest}%} is 3: set {_a1} to powered rail set {_a2} to "&dCS-GO &8(&a3&8)" if {Animacja::%{_chest}%} is 4: set {_a1} to activator rail set {_a2} to "&dReversed CS-GO &8(&a4&8)" if {Animacja::%{_chest}%} is 5: set {_a1} to spyglass set {_a2} to "&dCS-GO Upsidedown &8(&a5&8)" if {Animacja::%{_chest}%} is 6: set {_a1} to detector rail set {_a2} to "&dSpinning &8(&a6&8)" if {Animacja::%{_chest}%} is 7: set {_a1} to elytra set {_a2} to "&dKasyno &8(&a7&8)" if {Animacja::%{_chest}%} is 8: set {_a1} to ghast tear set {_a2} to "&dSnake &8(&a8&8)" set slot 40 of {_x} to {_a1} named "&aAnimacja %{_a2}%" with lore "&7Ustaw animacje LootBoxa, aby" and "&7wygladala ciekawiej!" and "" and "&eKliknij, aby zmienic!" open {_x} for {_player} on inventory click: if name of event-inventory is "&8Itemy": if clicked slot is gray stained glass pane named "&7": cancel event if clicked slot < 27: set {_chest} to uncolored name of slot 49 of current inventory of player set {_c1::*} to split {_chest} at " " set {_chestX} to {_c1::2} if click type is left mouse button with shift: if {szanse-%{_chestX}%::%index of clicked slot%} is set: cancel event if {szanse-%{_chestX}%::%index of clicked slot%} < 100: add 0.5 to {szanse-%{_chestX}%::%index of clicked slot%} EditItems(player, {_chestX}) if click type is right mouse button with shift: if {szanse-%{_chestX}%::%index of clicked slot%} is set: cancel event if {szanse-%{_chestX}%::%index of clicked slot%} > 0: remove 0.5 from {szanse-%{_chestX}%::%index of clicked slot%} EditItems(player, {_chestX}) 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 {_item} to slot {_x} of current inventory of player set {ItemLore::%{_chestX}%::%{_x}%::*} to lore of {_item} set {_item::*} to lore of {_item} set {_a} to size of {_item::*} if {_item::%{_a}%} is "&7Shift + Prawy, aby &aodjąć 0.5%%": loop 6 times: set {_y} to loop-value-2 set {_y2} to {_y} - 1 delete {_item::%{_a}-{_y2}%} set lore of {_item} to {_item::*} set {dropy-%{_chestX}%::%{_x}%} to {_item} if {szanse-%{_chestX}%::%{_x}%} is not set: if "%{dropy-%{_chestX}%::%{_x}%}%" is not "air": set {szanse-%{_chestX}%::%{_x}%} to 50 add 1 to {_x} close player's inventory send "&aZapisano!" EditChest(player, {_chestX}) command /chanceset [] [] []: permission: skrzynie.adm permission message: &cNie możesz używać tej komendy! trigger: if arg 1 and arg 2 and arg 3 are not set: send "&7Poprawne użycie: &a/chanceset [skrzynia] [slot] [szansa]" stop loop {chesty::*}: if loop-value contains arg 1: if arg 2 <= 35: if arg 3 <= 100: set {szanse-%arg 1%::%arg 2%} to arg 3 send "&aPomyślnie ustawiono procenty slotu %arg 2% w skrzyni %arg 1% na %arg 3%" stop else: send "&cNie możesz ustawić wiecej niż 100%%!" stop else: send "&cNie możesz ustawić slota na %arg 2% ponieważ nie ma tyle slotów w GUI!" stop else: send title "&cNie ma takiej skrzyni!" stop command /dropy []: aliases: drop trigger: if {chesty::*} contains arg-1: if player have tripwire hook named "&aKlucz &6%arg 1%": set {_var} to "&aTAK" else: set {_var} to "&cNIE" Dropy(player, arg-1, {_var}) else: if arg-1 is not set: send "&cPodaj nazwe skrzynki!" stop send "&cNie ma takiej skrzynki!" stop function Dropy(player: player, chest: text, var: text): set {_x} to chest inventory with 5 rows named "&8Dropy &3(%{_chest}%)" set {_val} to 0 set slot (integers between 36 and 43) of {_x} to grey stained glass pane named "&7-" set slot 44 of {_x} to lime dye named "&5Otwórz skrzynie!" with lore " &7➜ &fKliknij, aby otworzyć" and "&f skrzynię &3%{_chest}%!" and "" and " &7➜ &fMożliwość otworzenia: %{_var}%" set slot 43 of {_x} to glowstone dust named "&eOtwieraj bez animacji!" with lore " &7➜ &fKliknij, aby otworzyć" and "&f skrzynię &3%{_chest}% &fbez animacji!" set slot 42 of {_x} to redstone dust named "&cOtwieraj masowo!" with lore " &7➜ &fKliknij, aby otworzyć" and "&f skrzynię &3%{_chest}% &fmasowo!" loop 36 times: set slot {_val} of {_x} to {dropy-%{_chest}%::%{_val}%} with lore "" and "&7Szansa: &a%{szanse-%{_chest}%::%{_val}%}%%%" add 1 to {_val} open {_x} for {_player} on inventory click: if name of event-inventory contains "&8Dropy": cancel event set {_split::*} to split uncolored name of event-inventory at " " replace all "(" and ")" with "" in {_split::2} if clicked slot is 44: if player have tripwire hook named "&aKlucz &6%{_split::2}%": OpenLb(player, "%{_split::2}%") else: close player's inventory send title "&cNie posiadasz klucza! &7(%{_split::2}%)" for 0.01 seconds show 40 dragon breath with speed 0.4 at targeted block push player backwards with speed 0.5 push player upwards with speed 0.2 if clicked slot is 43: if player have tripwire hook named "&aKlucz &6%{_split::2}%": set {_itemek} to LosujRarity("%{_split::2}%") remove tripwire hook named "&aKlucz &6%{_split::2}%" from player EndOpen(player, {_split::2}, {_itemek}, true) else: close player's inventory send title "&cNie posiadasz klucza! &7(%{_split::2}%)" for 0.01 seconds show 40 dragon breath with speed 0.4 at targeted block push player backwards with speed 0.5 push player upwards with speed 0.2 if clicked slot is 42: OpenAmountLb(player, {_split::2}, 1) function OpenAmountLb(p: player, skrzynia: text, amount: number): set {_x} to chest inventory with 3 rows named "&cWybierz ilość! &8(&b%{_skrzynia}%&8)" set slot 11 of {_x} to red wool named "&c-1" set slot 15 of {_x} to green wool named "&a+1" set {_i} to {_amount} of tripwire hook named "&aKlucz &6%{_skrzynia}%" with lore "" and "&bIlość: %{_amount}%" enchant {_i} with unbreaking 10 set slot 4 of {_x} to {_i} set slot 22 of {_x} to amethyst shard named "&aZatwierdź!" open {_x} to {_p} on inventory click: if name of event-inventory contains "&cWybierz ilość! ": cancel event set {_split::*} to split uncolored name of event-inventory at "(" replace all ")" with "" in {_split::2} set {_skrzynia} to {_split::2} set {_split2::*} to split uncolored line 2 of lore of slot 4 of event-inventory at " " set {_amount} to {_split2::2} parsed as number if clicked slot is 11: if ({_amount} - 1) <= 0: send "&cNie możesz już odjąć więcej!" stop remove 1 from {_amount} OpenAmountLb(player, {_skrzynia}, {_amount}) if clicked slot is 15: if ({_amount} + 1) > 64: send "&cNie możesz już dodać więcej!" stop add 1 to {_amount} OpenAmountLb(player, {_skrzynia}, {_amount}) if clicked slot is 22: if player has {_amount} of tripwire hook named "&aKlucz &6%{_skrzynia}%": close player's inventory remove {_amount} of tripwire hook named "&aKlucz &6%{_skrzynia}%" from player loop {_amount} times: set {_re} to LosujRarity("%{_skrzynia}%") EndOpen(player, {_skrzynia}, {_re}, false) send title "&aPomyślnie otworzono skrzynię %{_amount}%x razy!" to player else: send "&cNie masz potrzebnej ilości kluczy!" on click: loop {chesty::*}: if {loclb::%loop-value%} is event-block: if player is sneaking: if player have permission "lb.adm": EditChest(player, loop-value) cancel event else: cancel event else: cancel event if player have tripwire hook named "&aKlucz &6%loop-value%": set {_var} to "&aTAK" else: set {_var} to "&cNIE" Dropy(player, loop-value, {_var}) function LosujRarity(chest: text) :: item: loop {dropy-%{_chest}%::*}: if "%loop-value%" is not "air": add 1 to {_size} add {szanse-%{_chest}%::%{_size}-1%} to {_sum} set {_losowaliczba} to random integer between 0 and {_sum} set {_aktualny_przedzial} to 0 set {_x} to -1 loop {_size} times: add 1 to {_x} add {szanse-%{_chest}%::%{_x}%} to {_aktualny_przedzial} if {_losowaliczba} <= {_aktualny_przedzial}: if "%{dropy-%{_chest}%::%{_x}%}%" is not "air": return {dropy-%{_chest}%::%{_x}%} function Wait(LoopIndex: integer) :: integer: if {_LoopIndex} is 5: set {_wait} to 2 if {_LoopIndex} is 8: set {_wait} to 4 if {_LoopIndex} is 12: set {_wait} to 5 if {_LoopIndex} is 14: set {_wait} to 5.5 if {_LoopIndex} is 18: set {_wait} to 6 if {_LoopIndex} is 20: set {_wait} to 6.5 if {_LoopIndex} is 23: set {_wait} to 7 if {_LoopIndex} is 25: set {_wait} to 9 if {_LoopIndex} is 26: set {_wait} to 12 if {_LoopIndex} is 27: set {_wait} to 15 if {_LoopIndex} is 28: set {_wait} to 18 if {_LoopIndex} is 29: set {_wait} to 22 if {_LoopIndex} is 30: set {_wait} to 25 if {_LoopIndex} is 31: set {_wait} to 28 if {_LoopIndex} is 32: set {_wait} to 34 return {_wait}