Solved How can I prohibit the use of a player's inventory when a custom inventory is open?

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

VOIDDER

Member
Aug 23, 2018
27
0
1
33
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?
[doublepost=1667330096,1667330005][/doublepost]And another question: how to get metadata tag of open inventory of player?
[doublepost=1667330166][/doublepost]set {_check} to metadata tag of event-inventory
Not work...
 
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:
on inventory click:
  if player's current inventory is %inventory%:
    if event-inventory is player's inventory:
      cancel event
    else: #no need to add a condition here since the event-inventory can only be player's or the current
      #code goes here
 
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:
on inventory click:
  if player's current inventory is %inventory%:
    if event-inventory is player's inventory:
      cancel event
    else: #no need to add a condition here since the event-inventory can only be player's or the current
      #code goes here
Thank!
 
Status
Not open for further replies.