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.

Solved How to set loop to repeat until variable changed

Discussion in 'Skript' started by Jairo Echevarria, Apr 5, 2021.

Thread Status:
Not open for further replies.
  1. Jairo Echevarria

    Jairo Echevarria New Member

    Joined:
    Mar 28, 2021
    Messages:
    7
    Likes Received:
    0
    So am working on this code that would basically spawn items / shulkers every so often the dragon egg is placed

    on place of dragon egg:
    set artificial intelligence of shulker to false
    send "started"
    set {_status} to "on"
    if {_status} is "on":
    if player is in "world_the_end":
    wait 1 seconds
    chance of 80%:
    drop 1 End Stone
    chance of 80%:
    drop 1 Chorus Plant
    wait 1 seconds
    chance of 50%:
    spawn 1 shulker

    on mine of dragon egg:
    set {_status} to "off"
    if {_status} is "off":
    if player is in "world_the_end":
    send "Stopped"

    So I want {_status} to turn off and on the loop so that it would continue the loop until the status would change to off, in this case when the dragon egg is mined and on when placed. I would appreciate if someone could help me out with this
     
  2. Best Answer:
    Post #2 by TheRealUnderscore, Apr 5, 2021
  3. TheRealUnderscore

    Joined:
    Mar 31, 2019
    Messages:
    10
    Likes Received:
    1
    This is what I call the literal reason a while loop exists. Also, local variables don't pass through conditions, and please put your code into a code block next time (click on the + symbol above the text box when typing, then "Code").

    Pseudo-code:

    Code (Text):
    1. on place of dragon egg:
    2.   while event-block is a dragon egg:
    3.     do whatever
    4.     wait 1 tick
    5.  
     
    • Like Like x 1
Thread Status:
Not open for further replies.

Share This Page

Loading...