Chest Gui need help

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

Petervpg

Member
Jul 27, 2017
18
0
0
20
So I have this Skript where it opens a "Chest Gui" where there are 3 Shiny Music Disc and some grey glass panels in the sides.

So i tryied to write this
code_language.skript:
set slot 0 of player's current inventory to black stained glass named "&6" to be unstealable
And it dosent work. but when i remove the to be unstealable it works.
I also wanted to do that with you click on one of the 3 Music Disc you would buy it (Im Danish so ignore the Lore) I want to use the to close then run command but it dosent work :emoji_frowning:
code_language.skript:
set slot 2 of player's current inventory to strad music disc named "&c&lIronPolet" with lore "&aBruges til at åbne en &f&lIron Crate|| ||&aPris &2250$|| ||&4ADVARSEL||&aHusk at have plads i din inventory!" to close then run [ make console execute command "/cironpolet"]

And the /cironpolet command is a command I have longer down in my skript. again im Danish so ignore the text
code_language.skript:
command /cironpolet:
    executable by: player
    trigger:
        if player's balance is greater or equal to 250:
            execute console command "/scrate givekey IronCrate %player% 1"
            subtract 250 from player's balance
        else:
            send "&cDu har ikke penge nok!"


I really hope you guys can help me cause i really need this :emoji_grinning:
[doublepost=1514380573,1514380402][/doublepost]
So I have this Skript where it opens a "Chest Gui" where there are 3 Shiny Music Disc and some grey glass panels in the sides.

So i tryied to write this
code_language.skript:
set slot 0 of player's current inventory to black stained glass named "&6" to be unstealable
And it dosent work. but when i remove the to be unstealable it works.
I also wanted to do if you click on one of the 3 Music Disc you would buy it (Im Danish so ignore the Lore) I want to use the to close then run command but it dosent work :emoji_frowning:
code_language.skript:
set slot 2 of player's current inventory to strad music disc named "&c&lIronPolet" with lore "&aBruges til at åbne en &f&lIron Crate|| ||&aPris &2250$|| ||&4ADVARSEL||&aHusk at have plads i din inventory!" to close then run [ make console execute command "/cironpolet"]

And the /cironpolet command is a command I have longer down in my skript. again im Danish so ignore the text
code_language.skript:
command /cironpolet:
    executable by: player
    trigger:
        if player's balance is greater or equal to 250:
            execute console command "/scrate givekey IronCrate %player% 1"
            subtract 250 from player's balance
        else:
            send "&cDu har ikke penge nok!"


I really hope you guys can help me cause i really need this :emoji_grinning:
 
This should work, I haven't tested it though, goodluck!

code_language.skript:
#Chest GUI command
command /chest-gui:
    trigger:
        open chest with 3 rows named "&6Crate Key Shop" to player
        wait 1 tick
        set {_row0} to 0
        set {_row1} to 18
        format slot 13 of player with strad music disc named "&c&lIronPolet" with lore "&aBruges til at åbne en &f&lIron Crate|| ||&aPris &2250$|| ||&4ADVARSEL||&aHusk at have plads i din inventory!" to close then run [ make console execute command "/cironpolet"] #"make PLAYER execute command" instead of "make CONSOLE execute command" because you want the chest to open to the player, not the console
        loop 8 times:
            format slot {_row0} of player with black stained glass named "&0" to be unstealable
            format slot {_row1} of player with black stained glass named "&0" to be unstealable
            add 1 to {_row0}
            add 1 to {_row1}
#Crate key command
command /cironpolet:
    executable by: player
    trigger:
        if player's balance is greater or equal to 250:
            execute console command "/scrate givekey IronCrate %player% 1"
            subtract 250 from player's balance
        else:
            send "&cDu har ikke penge nok!"
 
This should work, I haven't tested it though, goodluck!

code_language.skript:
#Chest GUI command
command /chest-gui:
    trigger:
        open chest with 3 rows named "&6Crate Key Shop" to player
        wait 1 tick
        set {_row0} to 0
        set {_row1} to 18
        format slot 13 of player with strad music disc named "&c&lIronPolet" with lore "&aBruges til at åbne en &f&lIron Crate|| ||&aPris &2250$|| ||&4ADVARSEL||&aHusk at have plads i din inventory!" to close then run [ make console execute command "/cironpolet"] #"make PLAYER execute command" instead of "make CONSOLE execute command" because you want the chest to open to the player, not the console
        loop 8 times:
            format slot {_row0} of player with black stained glass named "&0" to be unstealable
            format slot {_row1} of player with black stained glass named "&0" to be unstealable
            add 1 to {_row0}
            add 1 to {_row1}
#Crate key command
command /cironpolet:
    executable by: player
    trigger:
        if player's balance is greater or equal to 250:
            execute console command "/scrate givekey IronCrate %player% 1"
            subtract 250 from player's balance
        else:
            send "&cDu har ikke penge nok!"


No it dident work but Thank you for trying to help me. Btw im playing 1.8.9
 
Status
Not open for further replies.