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!

DJ_Dogos

Member
Dec 19, 2023
42
0
6
15
Hello iam trying to make a 6-digit code vault and if you get it right it will teleport u at a location (cords), and if not it will say "&4Wrong Code"
 
So what is your issue right now? So you now know how to generate the code? Do you not know how to teleport? What code have you written so for for this? If your code has errors send them
 
I only want to do "On command (/Vault, it will show u a gui where u have 9 items - red stained glass named 1,2,3,4,5,6,7,8,9,0 and if u click at something it will show again but at the bottom show a paper with number u clicked at and it will repeat till 6 codes, and if it matches the code it will say "&aCVault is opening!" and if it not matches it only say u "&4Failed on opening a Vault!"

Just this
 
this is i made so far:

Code:
command /gui:
  trigger:
    open chest inventory with 8 rows named "&fEVault" to player
    wait 1 tick
    set slot 4 of player's current inventory to Red Concrete named "&7Guess The Correct Code To Open The Vault!"
    set slot 10 of player's current inventory to Red Stained Glass Pane named "&71"
    set slot 12 of player's current inventory to Red Stained Glass Pane named "&72"
    set slot 14 of player's current inventory to Red Stained Glass Pane named "&73"
    set slot 17 of player's current inventory to Red Stained Glass Pane named "&74"
    set slot 19 of player's current inventory to Red Stained Glass Pane named "&75"
    set slot 21 of player's current inventory to Red Stained Glass Pane named "&76"
    set slot 24 of player's current inventory to Red Stained Glass Pane named "&78"
    set slot 26 of player's current inventory to Red Stained Glass Pane named "&79"
    set slot 28 of player's current inventory to Red Stained Glass Pane named "&70"

on inventory click:
    if name of event-inventory is "&fVault":
 
this is i made so far:

Code:
command /gui:
  trigger:
    open chest inventory with 8 rows named "&fEVault" to player
    wait 1 tick
    set slot 4 of player's current inventory to Red Concrete named "&7Guess The Correct Code To Open The Vault!"
    set slot 10 of player's current inventory to Red Stained Glass Pane named "&71"
    set slot 12 of player's current inventory to Red Stained Glass Pane named "&72"
    set slot 14 of player's current inventory to Red Stained Glass Pane named "&73"
    set slot 17 of player's current inventory to Red Stained Glass Pane named "&74"
    set slot 19 of player's current inventory to Red Stained Glass Pane named "&75"
    set slot 21 of player's current inventory to Red Stained Glass Pane named "&76"
    set slot 24 of player's current inventory to Red Stained Glass Pane named "&78"
    set slot 26 of player's current inventory to Red Stained Glass Pane named "&79"
    set slot 28 of player's current inventory to Red Stained Glass Pane named "&70"

on inventory click:
    if name of event-inventory is "&fVault":
I'm not sure if you can make a gui with 8 rows but for the inventory click event you can check the name of the event-slot. I would make a new item which will display the current code that the player is writing. With each click append the name of the clicked slot to the name of that item and then add some sort of submit item which will read the name of the display item to see if the code it correct.
 
I would make the buttons do something like

Code:
command /gui:
    trigger:
        create a gui with virtual chest inventory with 3 rows named "Vault":
            make gui slot 0 with red concrete named "&71":
                set slot 9 of player to apple named ("%name of slot 9 of player%1") with lore "&7This is your current guess"
            make gui slot 9 with apple named "" with lore "&7This is your current guess"
            make gui slot 10 with diamond named "&bSubmit":
                if uncolored name of slot 9 of player is "1234":
                    send "You did it" to player
                else:
                    send "Oh no"

Code is not tested
(edit) You also don't need the inventory click event if you are using skript-gui
 
1707490788324.png