command /warp []: aliases: warpy, warps executable by: player trigger: if player doesn't have permission "essentials.warp": execute player command "ewarp" stop set {_warpy::*} to files in "plugins/Essentials/warps" if size of {_warpy::*} is smaller than 1: send "&c* &7Nie ma zadnych warpow." stop replace all ".yml" with "" in {_warpy::*} loop {_warpy::*}: if player has permission "essentials.warps.%loop-value%": add loop-value to {_warps::*} clear {_warpy::*} set {_strony} to ceil("%size of {_warps::*}%" parsed as integer /53) if arg 1 is between 1 and {_strony}: if size of {_warps::*} is smaller than 1: send "&c* &7Nie posiadasz uprawnien do zadnego warpu." stop set {_num} to "%size of {_warps::*}%" parsed as integer if {_num} is smaller than 1: stop set {_max} to arg * 53 set {_min} to {_max} - 52 if arg is smaller than {_strony}: open chest with 6 rows named "&9Warpy &8(&7%arg%&8)" to player if arg is equal to {_strony}: remove 1 from {_min} set {_rows} to ceil("%difference between {_min} and {_num}%" parsed as integer /9) open chest with {_rows} rows named "&9Warpy &8(&7%arg%&8)" to player wait 2 tick if {_num} is larger than or equal to 54: if arg is smaller than {_strony}: set player's current inventory's slot 53 to arrow named "&3&lNastepna strona" set {_i} to 0 loop {_warps::*}: if loop-index parsed as integer is between {_min} and {_max}: set player's current inventory's slot {_i} to paper named "&9%loop-value%" with lore "||&7Teleportacja na:||&c%loop-value%" add 1 to {_i} stop send "&c* &7Nie ma takiej strony: %arg%" on inventory click: if "%inventory name of player's current inventory%" contains "Warpy": if slot is smaller than 0: stop cancel event if player's current inventory's slot slot is arrow: set {_strona} to uncoloured inventory name of player's current inventory replace all "Warpy (" with "" in {_strona} replace all ")" with "" in {_strona} set {_strona} to {_strona} parsed as integer close player's inventory wait 2 tick execute player command "warp %{_strona}+1%" stop if player's current inventory's slot slot is not air: set {_warp} to uncoloured name of player's current inventory's slot slot close player's inventory wait 2 tick execute player command "ewarp %{_warp}%"