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.

NPC storage system

Discussion in 'Skript' started by SwiftSwordMC, Aug 9, 2020.

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

    SwiftSwordMC Member

    Joined:
    Aug 9, 2020
    Messages:
    1
    Likes Received:
    0
    Hey everyone, so I'm fairly new to skript and there's many things I have no idea about but basically I'm trying to make an npc that on right click, opens a chest gui that contains 2 items: 1 cauldron labeled "Small Personal Vault" and gold horse armor labeled "Upgrade Vault". If you click the "Small Personal Vault", it will open another chest gui with 2 rows that is essentially supposed to be your own personal (small) enderchest but without actually using an ender chest.

    The issue I'm having is: if I put something in there, it disappears after I close and re-open that gui.
    (by the way I'll link all the screenshots as attachments)

    I asked a skript help discord server and someone suggested me to make a "storage system that stores items in a list variable that is linked to a player". such as:
    Code (Text):
    1. {storage::%player%::*}
    Now, as I said, I'm fairly new to skript. I have NO idea what I'm doing in that regard. This is the code I made without the list variables:

    Code (Text):
    1. command /guiuisofsdfisdf:
    2. #no permission needed
    3.   trigger:
    4.     open virtual chest inventory with size 4 named "&7Vaults and Storage" to player
    5.     format gui slot 11 of player with cauldron named "&aSmall Personal Vault" with lore "&7Stores up to 1 row of items." and "&eClick &7to access you vault" to run:
    6.       execute player command "dshfgfs"
    7.     format gui slot 15 of player with gold horse armor named "&6Upgrade Vault" with lore "" and "&eClick &7to upgrade" to run:
    8.       execute player command "sdjhflsdkfha"
    9.     format gui slot 31 of player with barrier named "&fClose" with lore "" and "&eClick &7to close" to close
    10. command /dshfgfs:
    11.   trigger:
    12.     open virtual chest inventory with size 2 named "&7Small Personal Vault" to player
    13.     format gui slot 9 of player with gray stained glass pane to do nothing
    14.     format gui slot 10 of player with gray stained glass pane to do nothing
    15.     format gui slot 11 of player with gray stained glass pane to do nothing
    16.     format gui slot 12 of player with gray stained glass pane to do nothing
    17.     format gui slot 14 of player with gray stained glass pane to do nothing
    18.     format gui slot 15 of player with gray stained glass pane to do nothing
    19.     format gui slot 16 of player with gray stained glass pane to do nothing
    20.     format gui slot 17 of player with gray stained glass pane to do nothing
    21.     format gui slot 13 of player with barrier named "&fClose" with lore "" and "&eClick &7to close" to close
    22. command /sdjhflsdkfha:
    23.   trigger:
    24.     open virtual chest inventory with size 4 named "&7Confirmation" to player
    25.     format gui slot 13 of player with lime stained glass pane named "&fAre you sure?" with lore "" and "&7Please &eclick &7to &aconfirm!" to run:
    26.       execute player command "fhsdjkhflga"
    27.     format gui slot 31 of player with barrier named "&fClose" with lore "" and "&eClick &7to close" to close
    28. #when you right click the npc
    29. on right click on an entity:
    30.   if name of entity is "&fStorage Man":
    31.     execute player command "/guiuisofsdfisdf"
    Could someone please try to guide me through this or tell me an easier way to do this?
    I'll be sleeping for a while since it's 6 am right now where I live but when I wake up I'll see any replies that come up.
    Thanks very much.
     

    Attached Files:

Thread Status:
Not open for further replies.

Share This Page

Loading...