6-digit code vault

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

1707491137225.png
 
There should be an error in console when you start your server. Can you send a copy of that
 
ye
Code:
[15:02:16 INFO]: [skript-gui] Loading server plugin skript-gui v1.3
[15:02:16 INFO]: [skript-gui] Enabling skript-gui v1.3
[15:02:16 ERROR]: Error occurred while enabling skript-gui v1.3 (Is it up to date?)
ch.njol.skript.SkriptAPIException: Registration can only be done during plugin initialization
        at ch.njol.skript.Skript.checkAcceptRegistrations(Skript.java:1297) ~[Skript.jar:?]
        at ch.njol.skript.Skript.registerAddon(Skript.java:1319) ~[Skript.jar:?]
        at io.github.apickledwalrus.skriptgui.SkriptGUI.onEnable(SkriptGUI.java:37) ~[skript-gui-1.3.jar:?]
        at org.bukkit.plugin.java.JavaPlugin.setEnabled(JavaPlugin.java:281) ~[paper-api-1.20.1-R0.1-SNAPSHOT.jar:?]
        at io.papermc.paper.plugin.manager.PaperPluginInstanceManager.enablePlugin(PaperPluginInstanceManager.java:189) ~[paper-1.20.1.jar:git-Paper-196]
        at jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:104) ~[?:?]
        at java.lang.reflect.Method.invoke(Method.java:577) ~[?:?]
        at com.rylinaux.plugman.util.PaperPluginUtil.load(PaperPluginUtil.java:421) ~[PlugManX(1).jar:?]
        at com.rylinaux.plugman.command.LoadCommand.execute(LoadCommand.java:116) ~[PlugManX(1).jar:?]
        at com.rylinaux.plugman.PlugManCommandHandler.onCommand(PlugManCommandHandler.java:97) ~[PlugManX(1).jar:?]
        at org.bukkit.command.PluginCommand.execute(PluginCommand.java:45) ~[paper-api-1.20.1-R0.1-SNAPSHOT.jar:?]
        at org.bukkit.command.SimpleCommandMap.dispatch(SimpleCommandMap.java:155) ~[paper-api-1.20.1-R0.1-SNAPSHOT.jar:?]
        at org.bukkit.craftbukkit.v1_20_R1.CraftServer.dispatchCommand(CraftServer.java:987) ~[paper-1.20.1.jar:git-Paper-196]
        at org.bukkit.craftbukkit.v1_20_R1.command.BukkitCommandWrapper.run(BukkitCommandWrapper.java:64) ~[paper-1.20.1.jar:git-Paper-196]
        at com.mojang.brigadier.CommandDispatcher.execute(CommandDispatcher.java:265) ~[paper-1.20.1.jar:?]
        at net.minecraft.commands.Commands.performCommand(Commands.java:324) ~[?:?]
        at net.minecraft.commands.Commands.performCommand(Commands.java:308) ~[?:?]
        at net.minecraft.server.network.ServerGamePacketListenerImpl.performChatCommand(ServerGamePacketListenerImpl.java:2354) ~[?:?]
        at net.minecraft.server.network.ServerGamePacketListenerImpl.lambda$handleChatCommand$21(ServerGamePacketListenerImpl.java:2314) ~[?:?]
        at net.minecraft.util.thread.BlockableEventLoop.lambda$submitAsync$0(BlockableEventLoop.java:59) ~[?:?]
        at java.util.concurrent.CompletableFuture$AsyncSupply.run(CompletableFuture.java:1768) ~[?:?]
        at net.minecraft.server.TickTask.run(TickTask.java:18) ~[paper-1.20.1.jar:git-Paper-196]
        at net.minecraft.util.thread.BlockableEventLoop.doRunTask(BlockableEventLoop.java:153) ~[?:?]
        at net.minecraft.util.thread.ReentrantBlockableEventLoop.doRunTask(ReentrantBlockableEventLoop.java:24) ~[?:?]
        at net.minecraft.server.MinecraftServer.doRunTask(MinecraftServer.java:1338) ~[paper-1.20.1.jar:git-Paper-196]
        at net.minecraft.server.MinecraftServer.d(MinecraftServer.java:197) ~[paper-1.20.1.jar:git-Paper-196]
        at net.minecraft.util.thread.BlockableEventLoop.pollTask(BlockableEventLoop.java:126) ~[?:?]
        at net.minecraft.server.MinecraftServer.pollTaskInternal(MinecraftServer.java:1315) ~[paper-1.20.1.jar:git-Paper-196]
        at net.minecraft.server.MinecraftServer.pollTask(MinecraftServer.java:1308) ~[paper-1.20.1.jar:git-Paper-196]
        at net.minecraft.util.thread.BlockableEventLoop.managedBlock(BlockableEventLoop.java:136) ~[?:?]
        at net.minecraft.server.MinecraftServer.waitUntilNextTick(MinecraftServer.java:1286) ~[paper-1.20.1.jar:git-Paper-196]
        at net.minecraft.server.MinecraftServer.runServer(MinecraftServer.java:1174) ~[paper-1.20.1.jar:git-Paper-196]
        at net.minecraft.server.MinecraftServer.lambda$spin$0(MinecraftServer.java:317) ~[paper-1.20.1.jar:git-Paper-196]
        at java.lang.Thread.run(Thread.java:833) ~[?:?]
[15:02:16 INFO]: [skript-gui] Disabling skript-gui v1.3
 
Code:
command /vault:
    trigger:
        send "&fType a 6 digit code for a &aREWARD&f!" to the player
        create a gui with virtual chest inventory with 3 rows named "Vault":
            open the last gui for the player
            make gui slot 0 with red stained glass pane named "&71":
                set slot 21 of player to paper named "%name of slot 21 of player%1" with lore "&7This is your current guess"
            make gui slot 1 with red stained glass pane named "&72":
                set slot 21 of player to paper named "%name of slot 21 of player%2" with lore "&7This is your current guess"
            make gui slot 2 with red stained glass pane named "&73":
                set slot 21 of player to paper named "%name of slot 21 of player%3" with lore "&7This is your current guess"
            make gui slot 3 with red stained glass pane named "&74":
                set slot 21 of player to paper named "%name of slot 21 of player%4" with lore "&7This is your current guess"
            make gui slot 4 with red stained glass pane named "&75":
                set slot 21 of player to paper named "%name of slot 21 of player%5" with lore "&7This is your current guess"
            make gui slot 5 with red stained glass pane named "&76":
                set slot 21 of player to paper named "%name of slot 21 of player%6" with lore "&7This is your current guess"
            make gui slot 6 with red stained glass pane named "&77":
                set slot 21 of player to paper named "%name of slot 21 of player%7" with lore "&7This is your current guess"
            make gui slot 7 with red stained glass pane named "&78":
                set slot 21 of player to paper named "%name of slot 21 of player%8" with lore "&7This is your current guess"
            make gui slot 8 with red stained glass pane named "&79":
                set slot 21 of player to paper named "%name of slot 21 of player%9" with lore "&7This is your current guess"
            make gui slot 13 with red stained glass pane named "&70":
                set slot 21 of player to paper named "%name of slot 21 of player%0" with lore "&7This is your current guess"
            make gui slot 21 with paper named "" with lore "&7This is your current guess"
            make gui slot 23 with diamond named "&bSubmit":
                if uncolored name of slot 21 of player is "17":
                    send "&aOpening Vault...." to player
                    set slot 21 of player to paper named "" with lore "&7This is your current guess"
                else:
                    send "&4Oh no, you didn't got it right!"
                    set slot 21 of player to paper named "" with lore "&7This is your current guess"
 
Try this
AppleScript:
command /vault:
    trigger:
        send "&fType a 6 digit code for a &aREWARD&f!" to the player
        create a gui with virtual chest inventory with 3 rows named "Vault":
            loop (integers between 0 and 8):
                set {_num} to loop-number + 1
                make gui slot loop-number with red stained glass pane named "&7%{_num}%":
                    set name of slot 21 of player's current inventory to "%name of slot 21 of player's current inventory%%{_num}%"
            make gui slot 13 with red stained glass pane named "&70":
                set name of slot 21 of player's current inventory to "%name of slot 21 of player's current inventory%0"
            make gui slot 21 with paper named "&f" with lore "&7This is your current guess"
            make gui slot 23 with diamond named "&bSubmit":
                if uncolored name of slot 21 of player's current inventory is "17":
                    send "&aOpening Vault...." to player
                else:
                    send "&4Oh no, you didn't get it right!"
                    set name of slot 21 of player's current inventory to "&f"
        open the last gui for the player
 
Is there a way to do it without skript gui
Of course. You would have to set a variable to a chest inventory, set the slots of the chest, then open the inventory to the player. Additionally you would need to use the inventory click event to handle the clicking parts.