1. 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!

  2. LOOKING FOR A VERSION OF SKRIPT?

    You can always check out our Wiki for downloads and any other information about Skript!

Dismiss Notice
This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

TuSKe Gui being overwritten.

Discussion in 'Skript' started by oHeckGage, Jul 21, 2020.

Tags:
Thread Status:
Not open for further replies.
  1. oHeckGage

    oHeckGage Active Member

    Joined:
    Mar 24, 2020
    Messages:
    105
    Likes Received:
    5
    Code (Text):
    1.  
    2. command /shop:
    3.     trigger:
    4.         open virtual chest with size 3 named "&9Shop" to player
    5.         wait 1 tick
    6.         set {_slot} to 0
    7.         loop 27 times:
    8.             format gui slot {_slot} of player with random element out of {backgrounds::*} named " "
    9.             add 1 to {_slot}
    10.         format gui slot 10 of player with leather helmet named "&cComing Soon." with lore "&cComing Soon" to run:
    11.             open virtual chest named "&9&lArmor" to player
    12.             wait 1 tick
    13.  
    14. command /warps:
    15.     trigger:
    16.         open virtual chest with size 3 named "&9Warps" to player
    17.         wait 1 tick
    18.         set {_slot} to 0
    19.         set {builds} to location at -2.5, 4, -28 in world "build"
    20.         loop 100 times:
    21.             slot 10 is grass block
    22.             loop 27 times:
    23.                 if {_slot} is 10:
    24.                     add 1 to {_slot}
    25.                     format gui slot 10 of player with grass block named "&9Builds" to run:
    26.                         teleport player to {builds}
    27.                 format gui slot {_slot} of player with random element out of {backgrounds::*} named " "
    28.                 add 1 to {_slot}
    29.                 if {_slot} is 27:
    30.                     set {_slot} to 0
    31.             wait 1 seconds
    32.  

    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.
     
  2. CUrrUpt Enxo

    CUrrUpt Enxo Member

    Joined:
    Jul 26, 2019
    Messages:
    21
    Likes Received:
    0
    if you want to keep reformating that slot you can do

    Code (Text):
    1. While True:
    2.     if slot 10 of player's current inventory is grass block:
    3.          <insert other code>
    4.     else:
    5.         exit loop
    6.      
     
Thread Status:
Not open for further replies.

Share This Page

Loading...