TuSKe Gui being overwritten.

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

oHeckGage

Active Member
Mar 24, 2020
110
6
18
22
Code:
command /shop:
    trigger:
        open virtual chest with size 3 named "&9Shop" to player
        wait 1 tick
        set {_slot} to 0
        loop 27 times:
            format gui slot {_slot} of player with random element out of {backgrounds::*} named " "
            add 1 to {_slot}
        format gui slot 10 of player with leather helmet named "&cComing Soon." with lore "&cComing Soon" to run:
            open virtual chest named "&9&lArmor" to player
            wait 1 tick

command /warps:
    trigger:
        open virtual chest with size 3 named "&9Warps" to player
        wait 1 tick
        set {_slot} to 0
        set {builds} to location at -2.5, 4, -28 in world "build"
        loop 100 times:
            slot 10 is grass block
            loop 27 times:
                if {_slot} is 10:
                    add 1 to {_slot}
                    format gui slot 10 of player with grass block named "&9Builds" to run:
                        teleport player to {builds}
                format gui slot {_slot} of player with random element out of {backgrounds::*} named " "
                add 1 to {_slot}
                if {_slot} is 27:
                    set {_slot} to 0
            wait 1 seconds


Basically, I was trying to make a shop and I have this command and when I try and open the shop, this loop overwrites the gui, so you have to wait a while before opening the shop, and it's becoming a huge issue when you try and work on them. Any ideas on how to stop the loop? I know you can stop loops and stuff but yeah dunno. I tried to make it so if slot 10 was a grass block, but I don't know how. I tried to research the main issue but couldn't find anyone with the issue.
 
if you want to keep reformating that slot you can do

Code:
While True:
    if slot 10 of player's current inventory is grass block:
         <insert other code>
    else:
        exit loop
 
Status
Not open for further replies.