Skript icon indicating copy to clipboard operation
Skript copied to clipboard

Do If Issue

Open Th-Underscore opened this issue 5 years ago • 1 comments

Description

Using do if with stop loop fully stops the trigger, rather than just stopping the loop. Using an if statement makes it work fine.

Steps to Reproduce

Not sure how to format instructions, so I'll just send one of the snippets I tried debugging this. 1 (doesn't work):

on script load:
    loop 9 times:
        broadcast "%loop-value%"
        stop loop if loop-value is 5
    broadcast "we did it!"

2 (works):

on script load:
    loop 9 times:
        broadcast "%loop-value%"
        if loop-value is 5:
            stop loop
    broadcast "we did it!"

Expected Behavior

It should broadcast 1 to 5 in chat, then we did it!, but it only broadcasts 1 to 5.

Errors / Screenshots

1: image

2: image

Server Information

  • Server version/platform: Paper 1.16.5
  • Skript version: 2.5.3

Th-Underscore avatar May 10 '21 17:05 Th-Underscore

I remember once I was trying do if statement and it stopped the whole trigger instead of skipping the single effect line, but that was sometime ago and I stopped using the do if statement however I love it but I forgot about it after that, so this might be related but not sure.

AyhamAl-Ali avatar May 10 '21 17:05 AyhamAl-Ali