#Opcje w nazwach # [ID] - numer enderchestu # [EMPTYSLOT] - Puste sloty w danym enderchescie # [MAXSLOT] - Maksymalne sloty w danym enderchescie (dla wszystkich 27) # [checkPermission] - sprawdzanie czy posiada uprawnienie do otworzenia enderchestu (wyswietla "Nie" lub "Tak") options: #Nazwa GUI głównego MAIN_INVENTORY_NAME: "&9Enderchest" #ID to numer enderchestu 1-9 MAIN_INVENTORY_ENDERCHEST_NAME: "&7Enderchest &9[ID]" MAIN_INVENTORY_ENDERCHEST_LORE: "&7Lore 1" and "&7Sloty: &a[EMPTYSLOT]&7/&c[MAXSLOT]" and "&7To jest skrzynka numer &1[ID]" and "" and "&7Mozesz uzywac: &6[checkPermission]" #Ile enderchestow ma gracz chestPlayer: 3 #Ile enderchestow ma VIP i jego uprawnienia [MAX 9] chestVip: 5 permissionVip: "asteliks.enderchest.vip" #Ile enderchestow ma SVIP i jego uprawnienia [MAX 9] chestSvip: 9 permissionSvip: "asteliks.enderchest.svip" #Nazwa GUI poszczególnego enderchestu (dla wszystkich taka sama) INVENTORY_ENDERCHEST_NAME: "&9Enderchest &8(&7[ID]&8)" #Uprawnienia do uzywania /enderchest i /echest permissionCommand: "asteliks.enderchest.command" noPermission: "&cNie posiadasz uprawnien." #air - brak anotherSlot: gray glass pane named "&7" #Tego nie zmieniaj, bedzie pozniej do diagnostyki. error: &cBlad krytyczny. Powiadom administratora o nim. Kod bledu #Dalszy kod, bez wniku. Cala konfiguracje masz wyzej function ASTELIKS_noPermission(p: player): if difference between {asteliks::enderchest::%{_p}%} and now is larger than 15 seconds: send {@noPermission} to {_p} set {asteliks::enderchest::%{_p}%} to now if {asteliks::enderchest::%{_p}%} is not set: set {asteliks::enderchest::%{_p}%} to now add 16 seconds to {asteliks::enderchest::%{_p}%} ASTELIKS_noPermission({_p}) function ASTELIKS_checkPermission(p: player, i: integer) :: boolean: if {_i} is between 0 and 3: return true if {_i} is not between 0 and 3: if {_p} has permission "3": return false if {_i} is not between 0 and 3: if {_p} has permission "3": return false ASTELIKS_noPermission({_p}) return false function ASTELIKS_ENDERCHEST(p: player, id: text) :: inventory: if {_id} is "MAIN": #wesji demstracyjnej? set {_name} to {@MAIN_INVENTORY_NAME} set {_gui} to chest with 3 rows named {@MAIN_INVENTORY_NAME} loop 27 times: set slot ((loop-number)-1) of {_gui} to {@anotherSlot} loop 9 times: set {_name} to {@MAIN_INVENTORY_ENDERCHEST_NAME} set {_lore::*} to {@MAIN_INVENTORY_ENDERCHEST_LORE} replace all "[ID]" with "%loop-number%" in {_name} replace all "[ID]" with "%loop-number%" in {_lore::*} set {_size::*} to {asteliks::enderchest::%{_p}%::%loop-number%::*} remove all air from {_size::*} set {_min} to size of {_size::*} replace all "[EMPTYSLOT]" with "%{_min}%" in {_lore::*} #jakies rozwiazanie replace all "[MAXSLOT]" with "27" in {_lore::*} if ASTELIKS_checkPermission({_p}, (loop-number)) is true: replace all "[checkPermission]" with "Tak" in {_lore::*} replace all "[checkPermission]" with "Nie" in {_lore::*} if loop-number is larger than 4: replace all "[checkPermission]" with "Nie" in {_lore::*} set slot (8 + loop-number) of {_gui} to ender chest named {_name} with lore {_lore::*} return {_gui} stop else: if ("%{_id}%" parsed as integer) is between 1 and 3: set {_name} to {@INVENTORY_ENDERCHEST_NAME} replace all "[ID]" with {_id} in {_name} set {_name} to "%{_name}% %{_id}%" set {_gui} to chest with 3 rows named {_name} loop {asteliks::enderchest::%{_p}%::%{_id}%::*}: set slot (loop-index parsed as integer) of {_gui} to loop-value return {_gui} stop send "{@error} &6getInventoryElseBetweenEnderchest" to {_p} #stworzony on inventory close: set {_n} to {@INVENTORY_ENDERCHEST_NAME} replace all "[ID]" with uncoloured last 1 character of name of current inventory in {_n} set {_1} to name of player's current inventory if {_1} contains {_n}: #przez set {_id} to last 1 character of name of current inventory loop 27 times: set {asteliks::enderchest::%player%::%{_id}%::%(loop-number) - 1%} to slot ((loop-number) - 1) of player's current inventory #ze znajdziesz on rightclick on ender chest: cancel event open ASTELIKS_ENDERCHEST(player, "MAIN") to player on inventory click: if name of player's current inventory is {@MAIN_INVENTORY_NAME}: cancel event set {_slot} to (clicked slot).getIndex()#k if {_slot} is between 9 and 12:#n remove 8 from {_slot} if ASTELIKS_checkPermission(player, {_slot}) is true: close player's inventory wait 2 tick#u set {_slot} to "%{_slot}%" open ASTELIKS_ENDERCHEST(player, {_slot}) to player if {_slot} is between 13 and 17: send "&7To jest wersja demo, poczekaj na pelna wersje." stop#g command /enderchest []: aliases: echest #myslisz trigger: if player has permission {@permissionCommand}: open ASTELIKS_ENDERCHEST(player, "MAIN") to player stop#i ASTELIKS_noPermission(player) #To jest wersja demonstracyjna