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 How can I prohibit the use of a player's inventory when a custom inventory is open?

Discussion in 'Skript' started by VOIDDER, Nov 1, 2022.

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

    VOIDDER Member

    Joined:
    Aug 23, 2018
    Messages:
    27
    Likes Received:
    0
    Using the guide:
    https://forums.skunity.com/threads/vanilla-guis.8939/
    created inventory, they use a ban on the use of inventory slots through cancel event.

    Problem: The player can move items in his inventory, and what's the worst thing is to make a font + left mouse click, and the item will move to the free slot of the custom inventory. How to disable this?
    --- Double Post Merged, Nov 1, 2022, Original Post Date: Nov 1, 2022 ---
    And another question: how to get metadata tag of open inventory of player?
    --- Double Post Merged, Nov 1, 2022 ---
    set {_check} to metadata tag of event-inventory
    Not work...
     
  2. Best Answer:
    Post #2 by Jake*, Nov 2, 2022
  3. Jake*

    Supporter

    Joined:
    Jan 30, 2022
    Messages:
    117
    Likes Received:
    6
    Before helping you I'd like to ask you to not say "not work" when asking for help, it's an old joke and it doesn't make a great image for you, especially when asking for help.
    To fix your issue you must have a few conditions

    Code (Text):
    1. on inventory click:
    2.   if player's current inventory is %inventory%:
    3.     if event-inventory is player's inventory:
    4.       cancel event
    5.     else: #no need to add a condition here since the event-inventory can only be player's or the current
    6.       #code goes here
     
  4. VOIDDER

    VOIDDER Member

    Joined:
    Aug 23, 2018
    Messages:
    27
    Likes Received:
    0
    Thank!
     
Thread Status:
Not open for further replies.

Share This Page

Loading...