Stop Hotkey swap of item

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

    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!

ctrlcheeb

New Member
Aug 4, 2023
6
0
1
Hi, I am trying to make a menu item that can be clicked to open a navigator but is locked to one slot
Using events such as "on drop" and "on inventory click" and then cancelling the event i can stop players both moving and dropping the item.

However the issue is that player are still able to swap the slot using hotkeys to empty slots in the inventory or chests, is there anyway to prevent this.
Any help would be great, thanks
 
You could possibly set the player's hotbar right after they change, to make it look like they can't change hotbars:

and


Edit: Look at the examples
 
You could possibly set the player's hotbar right after they change, to make it look like they can't change hotbars:

and


Edit: Look at the examples
This will cancel the item if its in the players held slot but how do I prevent it from being swapped at all?
 
not possible really you just have to make it look like it's not being swapped at all. you want to try, actually look on the skunity documentation, and look for the expression that does this.