Solved Locking specific inventory slot of player

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

Dlazar

New Member
Feb 20, 2021
5
0
1
Hello everyone!
I have a server on Minehut and I have the Script plugin installed. I have made a lobby navigator but I don't want players to be able to move the navigator in their inventory. But because the server has creative and survival, I need players to be able to use the other inventory slots.
Any ideas on how to do this?
 
Code:
on inventory click:
    #possible conditions
    cancel event
You may check player's clicked slot, world that player is in, ...
 
Code:
on inventory click:
    #possible conditions
    cancel event
You may check player's clicked slot, world that player is in, ...
I have tried that and that locks the whole inventory from being modified, not just the one given slot.
 
Code:
if clicked slot = 7:
[doublepost=1613853753,1613851431][/doublepost]If this solved your problem, please mark the thread as solved and you may also mark my answer as the best one :emoji_wink:
 
  • Like
Reactions: Dlazar
I will, once I tested it out. I will do it tomorrow! Thank you
[doublepost=1613907007,1613853807][/doublepost]Hello, I put the code together, but I still can move the clock in my inventory/hotbar.
Here is the full code
Code:
on inventory click:
    if clicked slot = 9:
        cancel the event

And here is a screenshot of it.
Screenshot 2021-02-21 at 12.29.25.png

[doublepost=1613907549][/doublepost]I did something and now it works! Thank you!
 
Status
Not open for further replies.