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.

Selected hotbar slot

Discussion in 'Skript' started by ThePraZ, Sep 5, 2022.

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

    ThePraZ Member

    Joined:
    Feb 20, 2017
    Messages:
    35
    Likes Received:
    1
    Hello, I have a problem with the set current hotbar slot of player to 0, the problem is that it doesn't works and in reload its says that the hotbar slot of player can't be set to 0 because the latter is not an slot
     
  2. lotzy

    lotzy Active Member

    Joined:
    Mar 15, 2022
    Messages:
    138
    Likes Received:
    22
    use correct syntax
    For get any hotbar slot of player inventory
    slot %number% of player's inventory
    where %number% is 0 - 8

    Or get current hotbar slot:
    hotbar slot of player

    And you cannot set it to 0, only first expression can be set to some %itemtype%, like:
    Code (Text):
    1. set {_slot} to hotbar slot of player
    2. set slot {_slot} of player to (dirt named "someitem")
    If you wanna change only hotbar slot use:
    Code (Text):
    1. set player's held item to (dirt named "someitem")
     
Thread Status:
Not open for further replies.

Share This Page

Loading...