options: koxy-limit: 4 refile-limit: 7 perly-limit: 9 function CheckPlayerItems(p: player): while {_p} is online: if {_p} has {@refile-limit} golden apple: while {_p} has {@refile-limit} golden apple: remove 1 golden apple from {_p} add 1 to {Schowek::Refile::%{_p}%} if {_p} has {@koxy-limit} enchanted golden apple: while {_p} has {@koxy-limit} enchanted golden apple: remove 1 enchanted golden apple from {_p} add 1 to {Schowek::Koxy::%{_p}%} if {_p} has {@perly-limit} ender pearl: while {_p} has {@perly-limit} ender pearl: remove 1 ender pearl from {_p} add 1 to {Schowek::Perly::%{_p}%} wait 10 ticks function SchowekGui(p: player) :: inventory: set {_SchowekGui} to chest inventory named "&9&lSchowek" set slot (integers between 0 and 26) of {_SchowekGui} to gray stained glass pane set slot 13 of {_SchowekGui} to ender pearl named "&aEnder Pearly" with lore "&ePosiadasz: %{Schowek::Perly::%{_p}%}%" set slot 11 of {_SchowekGui} to golden apple named "&aRefile" with lore "&ePosiadasz: %{Schowek::Refile::%{_p}%}%" set slot 15 of {_SchowekGui} to enchanted golden apple named "&aKoxy" with lore "&ePosiadasz: %{Schowek::Koxy::%{_p}%}%" return {_SchowekGui} function setVariable(p: player): if {Schowek::Perly::%{_p}%} is not set: set {Schowek::Perly::%{_p}%} to 0 if {Schowek::Refile::%{_p}%} is not set: set {Schowek::Refile::%{_p}%} to 0 if {Schowek::Koxy::%{_p}%} is not set: set {Schowek::Koxy::%{_p}%} to 0 on inventory click: current inventory is not player's inventory if name of event-inventory is "&9&lSchowek": cancel event if clicked slot is 13: close player's inventory if player has {@perly-limit} ender pearl: stop while player doesn't have {@perly-limit} ender pearl: wait 1 tick if {Schowek::Perly::%player%} is greater than 0: give 1 ender pearl to player remove 1 from {Schowek::Perly::%player%} if clicked slot is 11: close player's inventory if player has {@refile-limit} golden apple: stop while player doesn't have {@refile-limit} golden apple: wait 1 tick if {Schowek::Refile::%player%} is greater than 0: give 1 golden apple to player remove 1 from {Schowek::Refile::%player%} if clicked slot is 15: close player's inventory if player has {@koxy-limit} enchanted golden apple: stop while player doesn't have {@koxy-limit} enchanted golden apple: wait 1 tick if {Schowek::Koxy::%player%} is greater than 0: give 1 enchanted golden apple to player remove 1 from {Schowek::Koxy::%player%} command /schowek []: trigger: open SchowekGui(player) to player on join: setVariable(player) CheckPlayerItems(player)