Set slot doesn't work for inventory and neither does format 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.

Sam1370

Member
Jun 11, 2017
17
1
0
46
Skript Version: Skript 2.2 (dev20c)
Skript Author: Bensku
Minecraft Version: 1.11

Set slot doesn't seem to work (and neither does format slot.) I'm trying to set a slot in the player's hotbar to a selector compass and it doesn't seem to work.

Code:
code_language.skript:
on join:
    player's world is "world":
        wait 1 tick
        set slot 36 of player's current inventory to compass named "&aSelector" with lore "&9Select something to do!"
on right click:
    if player is holding compass named "&aSelector":
        wait 1 tick
        open virtual dispenser inventory named "&a&nSelector" to player
        format gui slot 4 of player with grass block named "&aSurvival" with lore "&9Play vanilla survival" to close then run function doSomething()
function doSomething():
    broadcast "And it did"


Addons using (including versions):

SkQuery Lime 3.5.7, TuSKe 1.7.7.
 
Also, for the "set slot" one it should just be "player's inventory" not "player's current inventory" and idk if you were just testing stuff but slot 36 is the boots slot (hotbar is 0-8).

If you're just setting an item in a player's inventory you should definitely be using "set slot" not tuske GUIs
 
Last edited by a moderator:
Status
Not open for further replies.