Set slot in 1.11

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

Pavel

Member
Jan 26, 2017
6
0
0
23
Addons:
- Skellet
- SkQuery
- SkRayFall

I have this script:
code_language.skript:
command /hub:
  aliases: /lobby
  trigger:
    execute player command "server hub"

command /servers:
  trigger:
    open chest with 3 rows named "&8&lServer Selector" to player
    wait a tick
    set slot 0 of player's current inventory to white stained glass pane
    set slot 1 of player's current inventory to gray stained glass pane
    set slot 2 of player's current inventory to bookshelf named "&6&lSoon"
    set slot 3 of player's current inventory to gray stained glass pane
    set slot 4 of player's current inventory to black stained glass pane
    set slot 5 of player's current inventory to gray stained glass pane
    set slot 6 of player's current inventory to bookshelf named "&6&lSoon"
    set slot 7 of player's current inventory to gray stained glass pane
    set slot 8 of player's current inventory to white stained glass pane
    set slot 9 of player's current inventory to golden pickaxe named "&6&lSurvival"
    set slot 10 of player's current inventory to white stained glass pane
    set slot 11 of player's current inventory to gray stained glass pane
    set slot 12 of player's current inventory to black stained glass pane
    set slot 13 of player's current inventory to eye of ender named "&6&lHub"
    set slot 14 of player's current inventory to black stained glass pane
    set slot 15 of player's current inventory to gray stained glass pane
    set slot 16 of player's current inventory to white stained glass pane
    set slot 17 of player's current inventory to grass block of fortune 3 named "&6&lSkyblock"
    set slot 18 of player's current inventory to white stained glass pane
    set slot 19 of player's current inventory to gray stained glass pane
    set slot 20 of player's current inventory to bookshelf named "&6&lSoon"
    set slot 21 of player's current inventory to gray stained glass pane
    set slot 22 of player's current inventory to black stained glass pane
    set slot 23 of player's current inventory to gray stained glass pane
    set slot 24 of player's current inventory to bookshelf named "&6&lSoon"
    set slot 25 of player's current inventory to gray stained glass pane
    set slot 26 of player's current inventory to white stained glass pane


on inventory click:
  if inventory name of player's current inventory is "&8&lServer Selector":
    if clicked slot is 9:
      execute player command "server Survival"
    else if clicked slot is 13:
      execute player command "server Hub"
    else if clicked slot is 17:
      execute player command "server Skyblock"
    cancel event
  cancel event

It is working on 1.8.8
but on 1.11 either it does not want to set the items because the server can't recognize them or it can't detect an inventory click number.

Screenshot:
241d00b1ea704faaae653b9b4f172b32.png


Is there an addon that I'm missing or can you help me to fix that menu?
 
I was able to do this for my hub just using...
Code:
set slot 0 of player's inventory to compass named "&a&lServer Selector &7&l(Right-Click)"
 
I was able to do this for my hub just using...
Code:
set slot 0 of player's inventory to compass named "&a&lServer Selector &7&l(Right-Click)"
That's not the case. It's "current inventory", so... it opens a GUI chest. Your solution would just set in the player's inventory , not the GUI.
 
Which version of Skript are you running? also, are you using the proper version of skQuery for the 1.11.2? I'll kill you if you tell me "the latest", so please tell me the exact version of Skript & skQuery using "/about Skript" and "/about skQuery"
 
Try this I hope this work IS NOT TEST. If you still having errors tell me and show me the errors lines and the problem I see is you cant put 2 else if like this

else if {example.%player%} is "no"
give 1 diamond sword to the player
else if {example.%player%} is "yes"
give 1 iron sword to the player

this is wrong
is like this
else if {example.%player%} is "no"
give 1 diamond sword to the pleyer
else {example.%player%} is "si"
give 1 iron sword to the player

Idk if you get the point sorry I speack spanish


code_language.skript:
command /hub:
  aliases: /lobby
  trigger:
    execute player command "/server hub"
 
command /servers:
  trigger:
    open chest with 3 rows named "&8&lServer Selector" to player
    wait a tick
    format slot 0 of the player with 1 white stained glass pane
    format slot 1 of the player with 1 gray stained glass pane
    format slot 2 of the player with 1 bookshelf named "&6&lSoon"
    format slot 3 of the player with 1 gray stained glass pane
    format slot 4 of the player with 1 black stained glass pane
    format slot 5 of the player with 1 gray stained glass pane
    format slot 6 of the player with 1 bookshelf named "&6&lSoon"
    format slot 7 of the player with 1 gray stained glass pane
    format slot 8 of the player with 1 white stained glass pane
    format slot 9 of the player with 1 golden pickaxe named "&6&lSurvival" to close then run [make player execute command "/server Survival"]
    format slot 10 of the player with 1 white stained glass pane
    format slot 11 of the player with 1 gray stained glass pane
    format slot 12 of the player with 1 black stained glass pane
    format slot 13 of the player with 1 eye of ender named "&6&lHub" to close then run [make player execute command "/server Hub"]
    format slot 14 of the player with 1 black stained glass pane
    format slot 15 of the player with 1 gray stained glass pane
    format slot 16 of the player with 1 white stained glass pane
    format slot 17 of the player with 1 grass block of fortune 3 named "&6&lSkyblock" to close then run [make player execute command "/server Skyblock"]
    format slot 18 of the player with 1 white stained glass pane
    format slot 19 of the player with 1 gray stained glass pane
    format slot 20 of the player with 1 bookshelf named "&6&lSoon"
    format slot 21 of the player with 1 gray stained glass pane
    format slot 22 of the player with 1 black stained glass pane
    format slot 23 of the player with 1 gray stained glass pane
    format slot 24 of the player with 1 bookshelf named "&6&lSoon"
    format slot 25 of the player with 1 gray stained glass pane
    format slot 26 of the player with 1 white stained glass pane
 
Last edited by a moderator:
hmm... try changing the glass names to
code_language.skript:
black stained glass
instead of
code_language.skript:
black stained glass pane
? That works for me.
 
Status
Not open for further replies.