Solved Inventory Spot is Clear

Discussion in 'Spigot Plugin Development' started by Accessory, Jun 21, 2016.

Thread Status:
Not open for further replies.
  1. Hello. So on my server I have different purchasable ingame gadgets. When purchases, they're put into your own personal arsenal. This is how it looks currently:
    [​IMG]
    But the problem I have currently is whenever someone buys lets say the flower crown gadget (the golden helmet) but hasn't bought any other gadget before they, it will be placed in the spot shown above. Its a fixed location. What I want it to do is that when that inventory is loaded up it will place all the gadgets in the first empty spot is can find. I know this is confusing but bare with me. Let me explain for clarity:

    > A player has not gadgets.
    > A player purchases the Blaze Rod gadget and the Golden Helmet gadget. Both inventory locations are: Blaze Rod: 29 & Golden Helmet: 30.
    > Both gadgets will be placed in their inventory location.

    But. what I actually want to happen is that both of those gadgets will be placed in the first 2 empty spaces in the inventory.

    How would I go about doing this? If you need more clarification, please feel free to ask. Thank you.
     
  2. Very confusing explanation you got there.
     
    • Agree Agree x 2
  3. Make an integer with the value of the first slot to fill. Loop through gadgets, set that slot to the gadget, add 1 to the integer. Profit.

    Nice username, btw.
     
  4. I dont get what the problem is? I read that like 3 times.. More details into the problem please?
     
    • Agree Agree x 1
  5. @Trophonix Thanks! Your suggestion worked perfectly.
     
Thread Status:
Not open for further replies.