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 Trade/Craft GUI [Please Click]

Discussion in 'Skript' started by Selvati, Jul 30, 2017.

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

    Selvati Active Member

    Joined:
    Jun 26, 2017
    Messages:
    190
    Likes Received:
    9
    I come to the skUnity community today asking for help on how to implement a custom trading / crafting gui into the game using skript and its addons.

    The Idea:
    Using skript and addons I would want to open a gui / inventory to a player, and be able to format certain slots, and allow the player to place things inside this inventory, if the player puts in certain items and has those items in certain slots, then you will get a product, similar to crafting but more possibilities. Ability to test for certain items in certain slots of the inventory!!!
    Also if the player has items in the inventory and closes the inventory, it returns the items to the player.

    Example:
    In this example, pretend I made a custom recipe, texting certain slots for certain items, using the picture below
    DoubleChest-slots.png
    slots 54 through 89 are the player's inventory and are irrelevant for now, I would like to be able to test for items in slots 0 through 53 in the inventory that is opened to the player and if the slots match the 'recipe' then show and item in slot x, and when the product item in slot x is clicked, remove the crafting materials and give the product to the player, so pretty much like a crafting table but in a custom gui for added fun. :emoji_slight_smile:

    Ex.
    if slot 10 of inventory opened to player is diamond_boots
    set slot 16 to 4 diamonds
    if player takes slot 16
    set slot 10 to air
    (if player closes inventory during crafting process, return crafting materials to player)

    Where I need help:
    I am very proficient when it comes to skript if I say so myself, but I am also certainly no pro at it!
    I would like to know the basic skripting to start this project off and any suggestions besides making a custom crafting table recipe.

    If you need even more information, please tag me in a reply to this thread.
    Thanks in advance, Selvati.
     
  2. ShaneBee

    Moderator Resource Staff Supporter + Addon Developer

    Joined:
    Sep 7, 2017
    Messages:
    2,184
    Likes Received:
    220
    So you haven't got code started yet for it if I understand right? Your code would be helpful if you do.
    Elsewise if you're looking for a place to start, I'd look into Tuske's addon for setting up your GUI. With that addon, the GUI will do most of the work in a skript like this.
     
    • Like Like x 1
  3. ShaneBee

    Moderator Resource Staff Supporter + Addon Developer

    Joined:
    Sep 7, 2017
    Messages:
    2,184
    Likes Received:
    220
    First off, I appreciate the quick reply ♥! But, yeah I do not have any code as of yet, I was planning on using Tuske for this, but the issue I ran into was I have no idea how to open the same inventory to more than one person (2 in this case). I googled intensively and found nothing, thanks!
     
  4. ShaneBee

    Moderator Resource Staff Supporter + Addon Developer

    Joined:
    Sep 7, 2017
    Messages:
    2,184
    Likes Received:
    220
    hmm...if you do it by command ,like /trade <player1> <player2>, you could open a gui to both player arguments. then when a player with the gui open clicks an item in their inventory it gets set to a slot on their side of the gui in both player gui's.:emoji_slight_smile:
     
  5. ShaneBee

    Moderator Resource Staff Supporter + Addon Developer

    Joined:
    Sep 7, 2017
    Messages:
    2,184
    Likes Received:
    220
    That sounds like it will do the trick, I will try when I get a chance tomorrow morning, thanks for the help! I will post an update tomorrow for everyone wanting to know!
     
    • Friendly Friendly x 1
  6. ShaneBee

    Moderator Resource Staff Supporter + Addon Developer

    Joined:
    Sep 7, 2017
    Messages:
    2,184
    Likes Received:
    220
    For sure! Best of luck:emoji_grinning:
     
Thread Status:
Not open for further replies.

Share This Page

Loading...