1. 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!

  2. LOOKING FOR A VERSION OF SKRIPT?

    You can always check out our Wiki for downloads and any other information about Skript!

Dismiss Notice
This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Solved inventory menu (next page & previous page) problem

Discussion in 'Skript' started by kenkencw, Jun 8, 2017.

Thread Status:
Not open for further replies.
  1. kenkencw

    kenkencw Active Member

    Joined:
    Jan 31, 2017
    Messages:
    68
    Likes Received:
    0
    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 (Skript):
    1. function run1(p: player):
    2.     open chest with 5 rows named "run1" to {_p}
    3.     wait 1 tick
    4.     # bla bla bla...
    5.  
    6.     format slot 53 of {_p} with ender eye named "&a&lNext Page" to close then run [cliamitem_pg2({_p})]
    7.    
    8.    
    9. function run2(p: player):
    10.     open chest with 5 rows named "run2" to {_p}
    11.     wait 1 tick
    12.     # # bla bla bla...
    13.  
    14.     format slot 45 of {_p} with ender pearl named "&c&lPrevious Page" to close then run [cliamitem_pg1({_p})]
    15.    
    16.    
    17. command /test:
    18.     trigger:
    19.         set {_p} to player
    20.         run1({_p})
     
  2. Best Answer:
    Post #2 by ShaneBee, Jun 8, 2017
  3. ShaneBee

    Moderator Resource Staff Supporter + Addon Developer

    Joined:
    Sep 7, 2017
    Messages:
    2,179
    Likes Received:
    218
    PLEASE use TuSKe for GUIs :
    • Functions are well-implemented
    • skQuery's GUIs are filled with bugs
    • TuSKe's GUI Manager is kept up to date, whereas skQuery isn't
    • On the TuSKe GUI Manager page (which you should check out), there is a multipage GUI example
     
    • Like Like x 1
    • Useful Useful x 1
  4. ShaneBee

    Moderator Resource Staff Supporter + Addon Developer

    Joined:
    Sep 7, 2017
    Messages:
    2,179
    Likes Received:
    218
    if youre using example Top List then do this:


    Code (Skript):
    1. command /top [<integer = 1>]:
    2.     trigger:
    3.         set {_n} to 0
    4.         set {_p} to 1
    5.         loop {Top::*}:
    6.             set {_Page::%{_p}::%loop-index%} to loop-value
    7.             add 1 to {_n}
    8.             if {_n} is 36:
    9.                 set {_n} to 0
    10.                 add 1 to {_p}
    11.         open chest with 5 rows named "Unlimited page" to player
    12.         set {_s} to 0
    13.         loop {_Page::%arg-1%::*}:
    14.             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%"
    15.             add 1 to {_s}

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

Share This Page

Loading...