Solved Item Duplicates in Inventory

  • 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!

  • LOOKING FOR A VERSION OF SKRIPT?

    You can always check out skUnity Downloads for downloads and any other information about Skript!

Status
Not open for further replies.

QmanRocks

New Member
Aug 2, 2021
7
0
1
16
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
 
Status
Not open for further replies.