Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- command /menu [<int=1>]:
- trigger:
- set {_p} to arg-1
- set {_mp} to ceil((size of {loop::*} / 44))
- if {_p} > {_mp}:
- make player execute command "/menu %{_mp}%"
- stop
- open chest with 6 rows named "&cLoopTest &f(page %{_p}%/%{_mp}%)" to player
- if size of {loop::*} > 44:
- #=================================================
- set {_index} to 0
- loop {loop::*}:
- if {_index} >= {_p} * (5 * 9) - 5 * 9:
- if {_index} < {_p} * 5 * 9:
- create a gui slot {_index} of player with stone named "&c%loop-value%" with lore "" to do nothing
- add 1 to {_index}
- #=================================================
- if {_p} != {_mp}:
- format gui slot 53 of player with an arrow named "&eSuivant" to run player command "/menu %({_p} + 1)%"
- if {_p} != 1:
- format gui slot 45 of player with an arrow named "&ePrécédent" to run player command "/menu %({_p} - 1)%"
- else:
- set {_si} to size of {loop::*}
- loop {_si} times:
- loop {loop::*}:
- set {_s} to loop-value-1
- format gui slot ({_s} - 1) of player with stone named "%loop-value-2%" to do nothing
- exit 1 section
- format gui slot 49 of player with paper named "&ePage actuelle : &f%{_p}%" with lore "&eMax page: &f%{_mp}%"
- on load:
- clear {loop::*}
- set {_r} to a random integer between 2 and 200
- broadcast "entre 1 et %{_r}%"
- loop all integers between 1 and {_r}:
- add loop-value to {loop::*}
Advertisement
Add Comment
Please, Sign In to add comment