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 chest GUI to save items

Discussion in 'Skript' started by Ubya, Jun 15, 2020.

Tags:
Thread Status:
Not open for further replies.
  1. Ubya

    Ubya Member

    Joined:
    Jun 15, 2020
    Messages:
    10
    Likes Received:
    0
    i'm making a game, i need to set a few items players need to find. instead of putting the items in the skript, i thought it would be nicer if i could do that in game.
    what i want to do is open a chest gui with a command, i can then drag and drop items in this chest inventory, and save the items in a variable when i close the GUI.

    i tried using TuSke
    Code (Text):
    1. command /bingolist:
    2.     permission: bingo.admin
    3.     trigger:
    4.         create a gui with id "BingoList" with virtual chest with 6 rows named "&6Bingo List":
    5.             set {_slot} to 0
    6.             loop 52 times:
    7.                 format gui slot {_slot} with {bingo::%{_slot}%}
    8.                 add 1 to {_slot}
    9.             format gui slot 53 with shiny lime dye named "Save":
    10.                 set {_slot} to 0
    11.                 loop 52 times:
    12.                     if slot {_slot} of current inventory of player is not air:
    13.                         set {bingo::%{_slot}%} to slot {_slot} of current inventory of player
    14.                         add 1 to {_slot}
    15.                     else:
    16.                         add 1 to {_slot}
    17.                 message "&aSAVED"
    18.                 close player's inventory
    19.         open gui "BingoList" to player
    what this code "SHOULD" do is, open a chest GUI when i type /bingolist, in the slot 53 is filled with a lime dye that upon clicking closes the GUI and saves what's inside it. when i reopen the GUI i should see the items i placed before.
    what really happens, if i use
    Code (Text):
    1. format gui slot {_slot} with {bingo::%{_slot}%}
    i can see the items, but i can't move them, or place new items (i could see some items as i made the variable before using this code).
    so i tried with
    Code (Text):
    1. set slot {_slot} of current inventory to {bingo::%{_slot}%}
    instead of the tuske format, and now i simply can't see anything in the inventory, only the lime dye
     
  2. pokw

    pokw Active Member

    Joined:
    Jun 3, 2019
    Messages:
    52
    Likes Received:
    1
    Try using sk-mirror.
     
  3. Ubya

    Ubya Member

    Joined:
    Jun 15, 2020
    Messages:
    10
    Likes Received:
    0
    that's a lot of informations (sarcasm)

    anyway i found a code that is working, so problem solved
     
Thread Status:
Not open for further replies.

Share This Page

Loading...