Solved inventory menu (next page & previous page) problem

  • Welcome to skUnity!

    Welcome to skUnity! This is a forum where members of the Skript community can communicate and interact. Skript Resource Creators can post their Resources for all to see and use.

    If you haven't done so already, feel free to join our official Discord server to expand your level of interaction with the comminuty!

    Now, what are you waiting for? Join the community now!

  • LOOKING FOR A VERSION OF SKRIPT?

    You can always check out skUnity Downloads for downloads and any other information about Skript!

Status
Not open for further replies.

kenkencw

Active Member
Jan 31, 2017
68
0
0
31
Malaysia
www.huskycraftmc.com
how to do inventory multiple page that can move next page & previous page perfectly?

this code run1 can go run2 (next page), but cannot go back run1 (previous page)
code_language.skript:
function run1(p: player):
    open chest with 5 rows named "run1" to {_p}
    wait 1 tick
    # bla bla bla...

    format slot 53 of {_p} with ender eye named "&a&lNext Page" to close then run [cliamitem_pg2({_p})]
    
    
function run2(p: player):
    open chest with 5 rows named "run2" to {_p}
    wait 1 tick
    # # bla bla bla...

    format slot 45 of {_p} with ender pearl named "&c&lPrevious Page" to close then run [cliamitem_pg1({_p})]
    
    
command /test:
    trigger:
        set {_p} to player
        run1({_p})
 
if youre using example Top List then do this:


code_language.skript:
command /top [<integer = 1>]:
    trigger:
        set {_n} to 0
        set {_p} to 1
        loop {Top::*}:
            set {_Page::%{_p}::%loop-index%} to loop-value
            add 1 to {_n}
            if {_n} is 36:
                set {_n} to 0
                add 1 to {_p}
        open chest with 5 rows named "Unlimited page" to player
        set {_s} to 0
        loop {_Page::%arg-1%::*}:
            set slot {_s} of player's current inventory to ("%loop-index%" parsed as offline player)'s skull named "%loop-index%" with lore "Kills: %loop-value%"
            add 1 to {_s}


This is just example.
 
Status
Not open for further replies.