Can't stop loop?

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

Aidan

Member
Aug 7, 2020
12
0
1
28
I have a simple script, but I can't find out how to stop this loop. Can anyone help me?

Code:
on join:
  if the player's world is "pvp":
    loop 1000 times:
      wait 100 seconds
      make console execute "eco give %player% 100"
      make console execute "give %player% stick 1"
      wait 100 seconds
      make console execute "eco give %player% 100"
      make console execute "give %player% iron_ingot 1"
      wait 100 seconds
      make console execute "give %player% iron_ingot 1"
      make console execute "give %player% lapiz_lazuli 1"
      message "&8[&aNotice&8] &cVisit the shop keeper!"
  if player's world is not "pvp":
    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')
 
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
Reactions: Aidan
Status
Not open for further replies.