Solved Set hotbar slot

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

Fridious

Member
Jun 23, 2017
33
0
0
47
Hey,
how can i that if you rightklick the slimeball, that the hotbarslot is selected to slot 1, because of my last line, there no happend

My script:

code_language.skript:
on rightclick with slimeball:
    wait 3 ticks
    set slot 0 of player to compass named "&cNavigator &7(Rechtsklick)"
    set slot 1 of player to air
    set slot 2 of player to air
    set slot 3 of player to air
    set slot 4 of player to air
    set slot 5 of player to air
    set slot 6 of player to air
    set slot 7 of player to air
    set slot 8 of player to air
    wait 3 ticks
    set selected hotbar slot 1 of player


Thank you
 
I don't know, but I think what you can make this with Packets.

Pd: I think... this is better and compact no?
code_language.skript:
    set slot 1 of player to air #Change this
    set slot 2 of player to air
    set slot 3 of player to air
    set slot 4 of player to air
    set slot 5 of player to air
    set slot 6 of player to air
    set slot 7 of player to air
    set slot 8 of player to air

    set slot 1 and 2 and 3 and 4 and 5 and 6 and 7 and 8 of player to air #By this
 
This should work, haven't tried it though!
code_language.skript:
on rightclick with slimeball:
    wait 3 ticks
    set slot 0 of player to compass named "&cNavigator &7(Rechtsklick)"
    set slot 1 of player to air
    set slot 2 of player to air
    set slot 3 of player to air
    set slot 4 of player to air
    set slot 5 of player to air
    set slot 6 of player to air
    set slot 7 of player to air
    set slot 8 of player to air
    wait 3 ticks
    set current hotbar slot of player to 1
 
This should work, haven't tried it though!
code_language.skript:
on rightclick with slimeball:
    wait 3 ticks
    set slot 0 of player to compass named "&cNavigator &7(Rechtsklick)"
    set slot 1 of player to air
    set slot 2 of player to air
    set slot 3 of player to air
    set slot 4 of player to air
    set slot 5 of player to air
    set slot 6 of player to air
    set slot 7 of player to air
    set slot 8 of player to air
    wait 3 ticks
    set current hotbar slot of player to 1
Tha
[doublepost=1498506110,1498506075][/doublepost]
Thank you :emoji_slight_smile:
 
This should work, haven't tried it though!
code_language.skript:
on rightclick with slimeball:
    wait 3 ticks
    set slot 0 of player to compass named "&cNavigator &7(Rechtsklick)"
    set slot 1 of player to air
    set slot 2 of player to air
    set slot 3 of player to air
    set slot 4 of player to air
    set slot 5 of player to air
    set slot 6 of player to air
    set slot 7 of player to air
    set slot 8 of player to air
    wait 3 ticks
    set current hotbar slot of player to 1

Wasting lines, this is much more shorter.
code_language.skript:
on rightclick with slimeball:
    wait 3 ticks
    set slot 0 of player to compass named "&cNavigator &7(Rechtsklick)"
    set {_n} to 1
    loop 8 times:
        set slot {_n} of player to air
        add 1 to {_n}
    wait 3 ticks
    set current hotbar slot of player to 1
 
Status
Not open for further replies.