Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function listHomes(pl: offline player, p: player, page: number):
- set {_liststart} to 9*{_page}
- set {_i} to 1
- set {_a} to 0
- wait 1 second
- open virtual chest inventory with size 2 named "&9%{_pl}%&9's Homes" to {_p}
- loop {home.%{_pl}%::*}:
- set {_home} to loop-value
- (loop-index parsed as integer) > {_liststart}
- format gui slot {_a} of {_p} with chest named "&d%loop-value%" with lore "&9Right click to delete||&9Left click to TP" to run function homeTp({_pl}, {_p}, {_txt}) with left click
- format gui slot {_a} of {_p} with chest named "&d%loop-value%" with lore "&9Right click to delete||&9Left click to TP" to run function homeDel({_p}, {_home}) with right click
- add 1 to {_a}
- if {_a} = ((9*{_i})):
- exit loop
- format gui slot 13 of {_p} with eye of ender named "&dRefresh" to run function listHomes({_pl}, {_p}, 0)
- if {homes-count.%{_pl}%} > {liststart} + 9:
- format gui slot 17 of {_p} with emerald named "&dNext Page" to run function listHomes({_pl}, {_p}, ({_page} + 1))
- if {_page} > 0:
- format gui slot 9 of {_p} with emerald named "&dPrevious Page" to run function listHomes({_pl}, {_p}, ({_page} - 1))
- function homeTp(pl: offline player, p: player, txt: text):
- make {_p} execute command "/home %{_pl}%:%{_txt}%"
- function myhomeTp(p: player, txt: text):
- make {_p} execute command "/home %{_txt}%"
- function homeDel(pl: offline player, p: player, home: text):
- loop {home.%{_pl}%::*}:
- if "%{_home}%" = "%loop-value%":
- delete {home.%{_p}%::%loop-index%}
- make {_p} execute command "/essentials:delhome %{_pl}%:%{_home}%"
- send "&e&l[&b&lā&e&l] &r&7Deleted home ""%{_home}%""" to {_p}
- set {homes-count.%{_p}%} to {homes-count.%{_p}%} - 1
- if {homes-count.%{_p}%} < 0:
- set {homes-count.%{_p}%} to 0
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement