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 Locking specific inventory slot of player

Discussion in 'Skript' started by Dlazar, Feb 20, 2021.

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

    Dlazar New Member

    Joined:
    Feb 20, 2021
    Messages:
    5
    Likes Received:
    0
    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?
     
  2. Best Answer:
    Post #2 by Nikd0, Feb 20, 2021
  3. Nikd0

    Nikd0 Active Member

    Joined:
    May 30, 2020
    Messages:
    204
    Likes Received:
    19
    Code (Text):
    1. on inventory click:
    2.     #possible conditions
    3.     cancel event
    You may check player's clicked slot, world that player is in, ...
     
  4. Dlazar

    Dlazar New Member

    Joined:
    Feb 20, 2021
    Messages:
    5
    Likes Received:
    0
    I have tried that and that locks the whole inventory from being modified, not just the one given slot.
     
  5. Nikd0

    Nikd0 Active Member

    Joined:
    May 30, 2020
    Messages:
    204
    Likes Received:
    19
    Code (Text):
    1. if clicked slot = 7:
    --- Double Post Merged, Feb 20, 2021, Original Post Date: Feb 20, 2021 ---
    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 Like x 1
  6. Dlazar

    Dlazar New Member

    Joined:
    Feb 20, 2021
    Messages:
    5
    Likes Received:
    0
    I will, once I tested it out. I will do it tomorrow! Thank you
    --- Double Post Merged, Feb 21, 2021, Original Post Date: Feb 20, 2021 ---
    Hello, I put the code together, but I still can move the clock in my inventory/hotbar.
    Here is the full code
    Code (Text):
    1. on inventory click:
    2.     if clicked slot = 9:
    3.         cancel the event
    And here is a screenshot of it.
    Screenshot 2021-02-21 at 12.29.25.png
    --- Double Post Merged, Feb 21, 2021 ---
    I did something and now it works! Thank you!
     
Thread Status:
Not open for further replies.

Share This Page

Loading...