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!


    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

    Mar 28, 2021
    Likes Received:
    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

    Mar 31, 2019
    Likes Received:
    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").


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

Share This Page