Custom inventory

  • 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.

Gherrix

New Member
May 21, 2020
6
0
1
24
Hi, I would like to create a gui where players can put their items and save their items. How can I do ?
 
Hi, I would like to create a gui where players can put their items and save their items. How can I do ?
Code:
command /inventory [<text>]:
    usage: /inventory
    trigger:
        if arg-1 is not set:
            open chest with 6 rows named "Backpack" to player
            loop 54 times:
                if {inventory.slot%loop-number - 1%.%player's uuid%} is set:
                    set slot (loop-number - 1) of player's current inventory to {inventory.slot%loop-number - 1%.%player's uuid%}
        else:
            send "Unknown command."

on inventory close:
    if inventory name of current inventory of player is "Backpack":
        loop 54 times:
            if {inventory.slot%loop-number - 1%.%player's uuid%} is not air:
                set {inventory.slot%loop-number - 1%.%player's uuid%} to slot (loop-number - 1) of player's current inventory
            else:
                delete {inventory.slot%loop-number - 1%.%player's uuid%}

        send "&aInventory saved."
If it works, please mark this as best answer.
Proof: https://gyazo.com/c0e585233ec40fe57a404cbad52d1f7f
 
Last edited:
Status
Not open for further replies.