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.

Can't stop loop?

Discussion in 'Skript' started by Aidan, Aug 7, 2020.

Thread Status:
Not open for further replies.
  1. Aidan

    Aidan Member

    Joined:
    Aug 7, 2020
    Messages:
    12
    Likes Received:
    0
    I have a simple script, but I can't find out how to stop this loop. Can anyone help me?

    Code (Text):
    1. on join:
    2.   if the player's world is "pvp":
    3.     loop 1000 times:
    4.       wait 100 seconds
    5.       make console execute "eco give %player% 100"
    6.       make console execute "give %player% stick 1"
    7.       wait 100 seconds
    8.       make console execute "eco give %player% 100"
    9.       make console execute "give %player% iron_ingot 1"
    10.       wait 100 seconds
    11.       make console execute "give %player% iron_ingot 1"
    12.       make console execute "give %player% lapiz_lazuli 1"
    13.       message "&8[&aNotice&8] &cVisit the shop keeper!"
    14.   if player's world is not "pvp":
    15.     exit 1 loop

    The error message I get is:

    can't stop any loops as there are no loops present (arenas.sk, line 15: exit 1 loop')
     
  2. Juffix

    Juffix Member

    Joined:
    Apr 7, 2019
    Messages:
    19
    Likes Received:
    4
    You can fix it by adding 1 more tab to the last 2 lines but this skript is still pretty bad. I suggest you use the world change event / on join event with a while loop.
     
    • Like Like x 1
Thread Status:
Not open for further replies.

Share This Page

Loading...