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.

Custom inventory

Discussion in 'Skript' started by Gherrix, May 22, 2020.

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

    Gherrix New Member

    Joined:
    May 21, 2020
    Messages:
    6
    Likes Received:
    0
    Hi, I would like to create a gui where players can put their items and save their items. How can I do ?
     
  2. Dave

    Dave Active Member

    Joined:
    Jul 20, 2018
    Messages:
    228
    Likes Received:
    9
    Code (Text):
    1. command /inventory [<text>]:
    2.     usage: /inventory
    3.     trigger:
    4.         if arg-1 is not set:
    5.             open chest with 6 rows named "Backpack" to player
    6.             loop 54 times:
    7.                 if {inventory.slot%loop-number - 1%.%player's uuid%} is set:
    8.                     set slot (loop-number - 1) of player's current inventory to {inventory.slot%loop-number - 1%.%player's uuid%}
    9.         else:
    10.             send "Unknown command."
    11.  
    12. on inventory close:
    13.     if inventory name of current inventory of player is "Backpack":
    14.         loop 54 times:
    15.             if {inventory.slot%loop-number - 1%.%player's uuid%} is not air:
    16.                 set {inventory.slot%loop-number - 1%.%player's uuid%} to slot (loop-number - 1) of player's current inventory
    17.             else:
    18.                 delete {inventory.slot%loop-number - 1%.%player's uuid%}
    19.  
    20.         send "&aInventory saved."
    21.  
    If it works, please mark this as best answer.
    Proof: https://gyazo.com/c0e585233ec40fe57a404cbad52d1f7f
     
    #2 Dave, May 22, 2020
    Last edited: Jun 13, 2020
    • Useful Useful x 1
Thread Status:
Not open for further replies.

Share This Page

Loading...