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.

Take click inventory priority

Discussion in 'Skript' started by cheatchki, Jul 7, 2017.

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

    Supporter ++

    Joined:
    Jun 26, 2017
    Messages:
    49
    Likes Received:
    1
    So I am using a plugin called CrazyEnchantments, and one of their features is how they enchant the items with their enchantments. They use a click event in game, so when you drag and drop an enchantment onto a tool, piece of armor, etc.. it has a chance to apply it to the item. This is fantastic and all however I would like to create some incompatibility, I wrote a small skript to try it out, however the plugin Crazy Enchants is still taking priority even though I have skript set on a Highest priority. This is a part of his source code, and I'm pretty sure the place where he says "hey when a player clicks on an item in their inv with this item enchant it" starts on like 68, however from what I could tell I'm not able to change the event priority of that or if you can even have one for inventory clicks? anyways, yes is their a way so I can make skript take priority first.?
     
  2. ShaneBee

    Supporter + Addon Developer

    Joined:
    Sep 7, 2017
    Messages:
    2,184
    Likes Received:
    227
    We need your code.
     
  3. ShaneBee

    Supporter + Addon Developer

    Joined:
    Sep 7, 2017
    Messages:
    2,184
    Likes Received:
    227
    Here is the code, when I make a piece of stone with the correct matching lore, it works as it should, however if I do a diamond pick, the CrazyEnchants plugin takes priority which I don't want
    Code (Skript):
    1. on inventory click:
    2.     if name of cursor is "&b&lHellforged I":
    3.         set {_check} to 1
    4.         set {_times} to 1
    5.         while {_check} is 1:
    6.             if line {_times} of lore of clicked item is not set:
    7.                 set {_check} to 0
    8.             else:
    9.                 message "%line {_times} of lore of clicked item%"
    10.             if line {_times} of lore of clicked item is "&7Blast I":
    11.                 cancel event
    12.                 message "Sorry but those items do not work with each other"
    13.             add 1 to {_times}
     
Thread Status:
Not open for further replies.

Share This Page

Loading...