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.

How to check if slot (Slot number) is full?

Discussion in 'Skript' started by retronix, Aug 20, 2018.

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

    Supporter +

    Joined:
    Aug 18, 2018
    Messages:
    19
    Likes Received:
    0
    So im creating a gui basically when you put an item in and press recycle it outputs items into another spot in the gui

    https://gyazo.com/19662aa9642a01b571f3bdf9a7a96a9f

    When it gets to 64 it just dosent add the rest how do i make it so it will add it to a existing slot?

    Code (Skript):
    1. on rightclick on recycler:
    2.     if data value of clicked block is 0 or 1 or 2 or 3:
    3.         cancel the event
    4.         open virtual chest inventory with size 5 named "&2&lRECYCLER" to player
    5.         loop 45 times:
    6.             format gui slot loop-number -1 of player with gray stained glass named " " to do nothing
    7.         unformat gui slot 19 of player
    8.         unformat gui slot 23 of player
    9.         unformat gui slot 24 of player
    10.         unformat gui slot 25 of player
    11.         if {gui::recycler::current::1} is set:
    12.             set slot 23 of current inventory of player to {gui::recycler::current::1}
    13.         if {gui::recycler::current} is set:
    14.             set slot 19 of current inventory of player to {gui::recycler::current}
    15.         format gui slot 21 of player with anvil:0 named "&a&lClick to Recycle" to run:
    16.             if slot 19 of current inventory of player is iron sword:
    17.                 set slot 19 of current inventory of player to air
    18.                 add 2 iron ingot to slot 23 of current inventory of player
    19.                 add 1 stick to slot 24 of current inventory of player
    20. on inventory close:
    21.     if name of current inventory of player is "&2&lRECYCLER":
    22.         if slot 19 of current inventory of player is not air:
    23.             set {gui::recycler::current} to slot 19 of current inventory of player
    24.         else:
    25.             delete {gui::recycler::current}
    26.         if slot 23 of current inventory of player is not air:
    27.             set {gui::recycler::current::1} to slot 23 of current inventory of player
    28.         else:
    29.             delete {gui::recycler::current::1}
     
Thread Status:
Not open for further replies.

Share This Page

Loading...