Virtual chest

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

Tom1222322

Member
Feb 5, 2021
19
0
1
22
Hello, I've been trying to make a virtual chest skript but I keep failing at it:/ I've tried looking through forums and stuff but still, no luck:/ Here's the code I've tried using:
Code:
on npc right click:
    if citizen is named "&c&lSaugykla":
        open chest with 6 rows named "Saugykla" to player
        loop 54 times:
            set slot {_slot} of player's current inventory to {saugykla::1::%{_slot}%::%player%}
            add 1 to {_slot}

on inventory close:
    if inventory name of player's current inventory is "Saugykla":
        loop 54 times:
            set {saugykla::1::%{_slot}%::%player%} to slot {slot.%player%} of player's current inventory
            add 1 to {_slot}

But I get this error in my console:
Code:
[05:59:08 ERROR]: [Skript] In 1.13+ you cannot get the title name of an inventory outside of an InventoryClickEvent, Only if this inventory has an InventoryHolder may it be used in this state.

Oh and my version of Minecraft is 1.16.4 so I'm not sure if tuske supports it.
 
Last edited:
Status
Not open for further replies.