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 Item Duplicates in Inventory

Discussion in 'Skript' started by QmanRocks, Aug 2, 2021.

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

    QmanRocks New Member

    Joined:
    Aug 2, 2021
    Messages:
    6
    Likes Received:
    0
    I'm coding a plot menu where, when you right click with a certain item, it opens a menu, and each item in the menu is a command. The menu part is being handled by ChestCommands (plugin). However, I have it coded to give the player the item when they join, and to not let the player drop the item or move it out of their inv. But, when they click it, it keeps it in their inventory, but also gives them another one, being the one they got by clicking it. If they place it in their inventory, it basically dupes itself. This new one can't be moved, and when clicked, duplicates itself again. I want the skript to check if the clicked plot is plot 8 (the last one) and, if the item being moved is the diamond pickaxe, with the name "&5&lPlot Menu" and lore "Open the Plot Command Menu!", cancel the event.

    Code so far:
    on drop:
    event-item is a diamond pickaxe named "&5&lPlot Menu":
    line 1 of lore of event-item is "Open the Plot Command Menu!":
    cancel event

    on inventory click:
    clicked slot is a diamond pickaxe named "&5&lPlot Menu":
    line 1 of lore of clicked slot is "Open the Plot Command Menu!":
    clicked slot is slot 8: (<------- spits out an error)
    cancel event
     
  2. Best Answer:
    Post #2 by alexistb2904, Aug 2, 2021
  3. alexistb2904

    alexistb2904 New Member

    Joined:
    Jul 27, 2021
    Messages:
    8
    Likes Received:
    1
    Code (Text):
    1. if index of event-slot = 0:
    for the event clicked slot
     
  4. QmanRocks

    QmanRocks New Member

    Joined:
    Aug 2, 2021
    Messages:
    6
    Likes Received:
    0
    Yep, this fixed it. Thank you so much!
     
Thread Status:
Not open for further replies.

Share This Page

Loading...