Solved Another GUI inside the GUI

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

Danic

Member
Jul 23, 2020
42
0
6
Korea
www.youtube.com
I am working on the code to create a store GUI inside a store GUI!
But I got stuck in a 'loop'... Oh my god!
Please fix the error below. Help me, genius!

I used some Korean for the function.
I tried to change it one by one, but I gave up because it took too long.
Please understand me!

Code:
every seconds:
    loop all players:
        if {다나잡화점 메뉴.%loop-player%} is "buy":
            open chest with 5 rows named "좋은 물건들을 많이 구해놓았어요!" to loop-player
            format slot 10 of loop-player with white stained glass named "품절" with lore "상품이 품절되었어요..." to close
            format slot 12 of loop-player with white stained glass named "품절" with lore "상품이 품절되었어요..." to close
            format slot 14 of loop-player with white stained glass named "품절" with lore "상품이 품절되었어요..." to close
            format slot 16 of loop-player with white stained glass named "품절" with lore "상품이 품절되었어요..." to close
            format slot 28 of loop-player with white stained glass named "품절" with lore "상품이 품절되었어요..." to close
            format slot 30 of loop-player with white stained glass named "품절" with lore "상품이 품절되었어요..." to close
            format slot 32 of loop-player with white stained glass named "품절" with lore "상품이 품절되었어요..." to close
            format slot 34 of loop-player with white stained glass named "품절" with lore "상품이 품절되었어요..." to close
        if {다나잡화점 메뉴.%loop-player%} is "sell":
            open chest with 5 rows named "광물은 언제든지 환영이라구요!" to loop-player
            format slot 10 of loop-player with coal named "석탄 1개" with lore "구매가 : 1 에메" to close then run [execute op command "/give %loop-player% minecraft:emerald 1" and "/clear %loop-player% minecraft:coal 1"]
            format slot 12 of loop-player with charcoal named "목탄 5개" with lore "구매가 : 1 에메" to close then run [execute op command "/give %loop-player% minecraft:emerald 1" and "/clear %loop-player% minecraft:charcoal 5"]
            format slot 14 of loop-player with iron ingot named "철괴 1개" with lore "구매가 : 5 에메" to close then run [execute op command "/give %loop-player% minecraft:emerald 5" and "/clear %loop-player% minecraft:iron_ingot 1"]
            format slot 16 of loop-player with redstone dust named "레드스톤 10개" with lore "구매가 : 10 에메" to close then run [execute op command "/give %loop-player% minecraft:emerald 10" and "/clear %loop-player% minecraft:redstone_dust 10"]
            format slot 28 of loop-player with lapis lazuli named "청금석 10개" with lore "구매가 : 10 에메" to close then run [execute op command "/give %loop-player% minecraft:emerald 10" and "/clear %loop-player% minecraft:lapis_lazuli 10"]
            format slot 30 of loop-player with gold ingot named "금괴 1개" with lore "구매가 : 20 에메" to close then run [execute op command "/give %loop-player% minecraft:emerald 20" and "/clear %loop-player% minecraft:gold_ingot 1"]
            format slot 32 of loop-player with diamond named "다이아몬드 1개" with lore "구매가 : 에메 한 세트 (64개)" to close then run [execute op command "/give %loop-player% minecraft:emerald 64" and "/clear %loop-player% minecraft:diamond 1"]
            format slot 34 of loop-player with netherite ingot named "네더라이트 1개" with lore "구매가 : 100 에메" to close then run [execute op command "/give %loop-player% minecraft:emerald 100" and "/clear %loop-player% minecraft:netherite_ingot 1"]
        if {다나잡화점 메뉴.%loop-player%} is "special":
            open chest with 5 rows named "현재 준비중이에요!" to loop-player
            format slot 19 of loop-player with white stained glass named "품절" with lore "상품이 품절되었어요..." to close
            format slot 21 of loop-player with white stained glass named "품절" with lore "상품이 품절되었어요..." to close
            format slot 23 of loop-player with white stained glass named "품절" with lore "상품이 품절되었어요..." to close
            format slot 25 of loop-player with white stained glass named "품절" with lore "상품이 품절되었어요..." to close
        else:
            set {다나잡화점 메뉴.%loop-player%} to "none"

This is error code.

Code:
there's no loop that matches 'loop-player' with "blah blah blah..."
 
Please send the full error code, that isn't enough information, also I would recommend not using that way of making a GUI.
 
Please send the full error code, that isn't enough information, also I would recommend not using that way of making a GUI.

Oh, This is all error code.

Code:
there's no loop that matches 'loop-player with coal named "석탄 1개" with lore "구매가 : 1 에메" to close then run [execute op command "/give %loop-player% minecraft:emerald 1" and "/clear %loop-player% minecraft:coal 1"]' ( store.sk, line 35: format slot 10 of loop-player with coal named "석탄 1개" with lore "구매가 : 1 에메" to close then run [execute op command "/give %loop-player% minecraft:emerald 1" and "/clear %loop-player% minecraft:coal 1"]' )
there's no loop that matches 'loop-player with charcoal named "목탄 5개" with lore "구매가 : 1 에메" to close then run [execute op command "/give %loop-player% minecraft:emerald 1" and "/clear %loop-player% minecraft:charcoal 5"]' ( store.sk, line 36: format slot 12 of loop-player with charcoal named "목탄 5개" with lore "구매가 : 1 에메" to close then run [execute op command "/give %loop-player% minecraft:emerald 1" and "/clear %loop-player% minecraft:charcoal 5"]' )
there's no loop that matches 'loop-player with iron ingot named "철괴 1개" with lore "구매가 : 5 에메" to close then run [execute op command "/give %loop-player% minecraft:emerald 5" and "/clear %loop-player% minecraft:iron_ingot 1"]' ( store.sk, line 37: format slot 14 of loop-player with iron ingot named "철괴 1개" with lore "구매가 : 5 에메" to close then run [execute op command "/give %loop-player% minecraft:emerald 5" and "/clear %loop-player% minecraft:iron_ingot 1"]' )
there's no loop that matches 'loop-player with redstone dust named "레드스톤 10개" with lore "구매가 : 10 에메" to close then run [execute op command "/give %loop-player% minecraft:emerald 10" and "/clear %loop-player% minecraft:redstone_dust 10"]' ( store.sk, line 38: format slot 16 of loop-player with redstone dust named "레드스톤 10개" with lore "구매가 : 10 에메" to close then run [execute op command "/give %loop-player% minecraft:emerald 10" and "/clear %loop-player% minecraft:redstone_dust 10"]' )
' )
there's no loop that matches 'loop-player with lapis lazuli named "청금석 10개" with lore "구매가 : 10 에메" to close then run [execute op command "/give %loop-player% minecraft:emerald 10" and "/clear %loop-player% minecraft:lapis_lazuli 10"]' ( store.sk, line 39: format slot 28 of loop-player with lapis lazuli named "청금석 10개" with lore "구매가 : 10 에메" to close then run [execute op command "/give %loop-player% minecraft:emerald 10" and "/clear %loop-player% minecraft:lapis_lazuli 10"]')
there's no loop that matches 'loop-player with gold ingot named "금괴 1개" with lore "구매가 : 20 에메" to close then run [execute op command "/give %loop-player% minecraft:emerald 20" and "/clear %loop-player% minecraft:gold_ingot 1"]' ( store.sk, line 40: format slot 30 of loop-player with gold ingot named "금괴 1개" with lore "구매가 : 20 에메" to close then run [execute op command "/give %loop-player% minecraft:emerald 20" and "/clear %loop-player% minecraft:gold_ingot 1"]' )
there's no loop that matches 'loop-player with diamond named "다이아몬드 1개" with lore "구매가 : 에메 한 세트 (64개)" to close then run [execute op command "/give %loop-player% minecraft:emerald 64" and "/clear %loop-player% minecraft:diamond 1"]' ( store.sk, line 41: format slot 32 of loop-player with diamond named "다이아몬드 1개" with lore "구매가 : 에메 한 세트 (64개)" to close then run [execute op command "/give %loop-player% minecraft:emerald 64" and "/clear %loop-player% minecraft:diamond 1"]' )
there's no loop that matches 'loop-player with netherite ingot named "네더라이트 1개" with lore "구매가 : 100 에메" to close then run [execute op command "/give %loop-player% minecraft:emerald 100" and "/clear %loop-player% minecraft:netherite_ingot 1"]' ( store.sk, line 42: format slot 34 of loop-player with netherite ingot named "네더라이트 1개" with lore "구매가 : 100 에메" to close then run [execute op command "/give %loop-player% minecraft:emerald 100" and "/clear %loop-player% minecraft:netherite_ingot 1"]' )
 
Don't use skquery for guis, use vanilla instead. Here's a tutorial on vanilla guis https://forums.skunity.com/threads/vanilla-guis.8939/

Also, periodicals can cause lag, so try not to use them, instead, you should use while loops


Code:
on join:
    while player is online:
        wait 1 second
        #code


I am in an emergency.
The server is crashed and the following warning appears.
I think your code is causing this situation.
Is it related to use skQuery not to use vanilla?

Code:
[Skript] Cannot write variables to the database 'default' at sufficient speed; server performance may suffer and many variables will be lost if the server crashes. (this warning will be repeated at most once every 10 seconds)
[doublepost=1595841047,1595840454][/doublepost]
change all loop player to player

Look at this please.
Code:
on join:
    while player is online:
        if {다나잡화점 메뉴.%player%} is "buy":
            open chest with 5 rows named "좋은 물건들을 많이 구해놓았어요!" to player
            format slot 10 of player with white stained glass named "품절" with lore "상품이 품절되었어요..." to close
            format slot 12 of player with white stained glass named "품절" with lore "상품이 품절되었어요..." to close
            format slot 14 of player with white stained glass named "품절" with lore "상품이 품절되었어요..." to close
            format slot 16 of player with white stained glass named "품절" with lore "상품이 품절되었어요..." to close
            format slot 28 of player with white stained glass named "품절" with lore "상품이 품절되었어요..." to close
            format slot 30 of player with white stained glass named "품절" with lore "상품이 품절되었어요..." to close
            format slot 32 of player with white stained glass named "품절" with lore "상품이 품절되었어요..." to close
            format slot 34 of player with white stained glass named "품절" with lore "상품이 품절되었어요..." to close
        if {다나잡화점 메뉴.%player%} is "sell":
            open chest with 5 rows named "광물은 언제든지 환영이라구요!" to player
            format slot 10 of player with coal named "석탄 1개" with lore "구매가 : 1 에메" to close then run [execute op command "/give %player% minecraft:emerald 1" and "/clear %player% minecraft:coal 1"]
            format slot 12 of player with charcoal named "목탄 5개" with lore "구매가 : 1 에메" to close then run [execute op command "/give %player% minecraft:emerald 1" and "/clear %player% minecraft:charcoal 5"]
            format slot 14 of player with iron ingot named "철괴 1개" with lore "구매가 : 5 에메" to close then run [execute op command "/give %player% minecraft:emerald 5" and "/clear %player% minecraft:iron_ingot 1"]
            format slot 16 of player with redstone dust named "레드스톤 10개" with lore "구매가 : 10 에메" to close then run [execute op command "/give %player% minecraft:emerald 10" and "/clear %player% minecraft:redstone_dust 10"]
            format slot 28 of player with lapis lazuli named "청금석 10개" with lore "구매가 : 10 에메" to close then run [execute op command "/give %player% minecraft:emerald 10" and "/clear %player% minecraft:lapis_lazuli 10"]
            format slot 30 of player with gold ingot named "금괴 1개" with lore "구매가 : 20 에메" to close then run [execute op command "/give %player% minecraft:emerald 20" and "/clear %player% minecraft:gold_ingot 1"]
            format slot 32 of player with diamond named "다이아몬드 1개" with lore "구매가 : 에메 한 세트 (64개)" to close then run [execute op command "/give %player% minecraft:emerald 64" and "/clear %player% minecraft:diamond 1"]
            format slot 34 of player with netherite ingot named "네더라이트 1개" with lore "구매가 : 100 에메" to close then run [execute op command "/give %player% minecraft:emerald 100" and "/clear %player% minecraft:netherite_ingot 1"]
        if {다나잡화점 메뉴.%player%} is "special":
            open chest with 5 rows named "현재 준비중이에요!" to player
            format slot 19 of player with white stained glass named "품절" with lore "상품이 품절되었어요..." to close
            format slot 21 of player with white stained glass named "품절" with lore "상품이 품절되었어요..." to close
            format slot 23 of player with white stained glass named "품절" with lore "상품이 품절되었어요..." to close
            format slot 25 of player with white stained glass named "품절" with lore "상품이 품절되었어요..." to close
        else:
            set {다나잡화점 메뉴.%player%} to "none"
 
SkQuery's GUIS are not recommended by a lot of people and that's a sign there's something wrong with them xP
Use vanilla instead:
Code:
set slot %slot% of current inventory of player to %your item% #there is no "to be unstealable" or anything like it!
can u give a full example? ty
 
Code:
#....
    if {다나잡화점 메뉴.%player%} is "sell":
        open chest with 5 rows named "광물은 언제든지 환영이라구요!" to player
        set slot 10 of current inventory of player to coal named "석탄 1개" with lore "구매가 : 1 에메"
        #....

on inventory click:
    if name of current inventory of player is"광물은 언제든지 환영이라구요!":
        if clicked slot is 10:
            if clicked item is coal:
                execute console command "/give %player% emerald 1"
                execute console command "/clear %player%
 
Code:
#....
    if {다나잡화점 메뉴.%player%} is "sell":
        open chest with 5 rows named "광물은 언제든지 환영이라구요!" to player
        set slot 10 of current inventory of player to coal named "석탄 1개" with lore "구매가 : 1 에메"
        #....

on inventory click:
    if name of current inventory of player is"광물은 언제든지 환영이라구요!":
        if clicked slot is 10:
            if clicked item is coal:
                execute console command "/give %player% emerald 1"
                execute console command "/clear %player%
i dont understand the line

if {다나잡화점 메뉴.%player%} is "sell":

what does it mean and how do i use it
 
Read this, and stop asking how to make a vanilla gui when its LITERALLY on the tutorial
Tutorial on vanilla guis

Okay, I'll try it.
[doublepost=1595938470,1595937906][/doublepost]
Read this, and stop asking how to make a vanilla gui when its LITERALLY on the tutorial
Tutorial on vanilla guis

I think I am seriously misunderstanding.
Does it mean to switch to vanilla, not to download the program, but to change the syntax?
 
Last edited:
Status
Not open for further replies.