Skript

Skript

743k Downloads

Weird loop-value issue in Skript 2.9

ShaneBeee opened this issue ยท 0 comments

commented

Skript/Server Version

[11:10:28 INFO]: [Skript] Skript's aliases can be found here: https://github.com/SkriptLang/skript-aliases
[11:10:28 INFO]: [Skript] Skript's documentation can be found here: https://docs.skriptlang.org/
[11:10:28 INFO]: [Skript] Skript's tutorials can be found here: https://docs.skriptlang.org/tutorials
[11:10:28 INFO]: [Skript] Server Version: 1.21-DEV-aa8d38d (MC: 1.21)
[11:10:28 INFO]: [Skript] Skript Version: 2.8.7 (selfbuilt-unknown)
[11:10:28 INFO]: [Skript] Installed Skript Addons: 
[11:10:28 INFO]: [Skript]  - skript-reflect v2.4 (https://github.com/SkriptLang/skript-reflect)
[11:10:28 INFO]: [Skript]  - SkBee v3.5.5 (https://github.com/ShaneBeee/SkBee)
[11:10:28 INFO]: [Skript]  - SkBriggy v1.3.2
[11:10:28 INFO]: [Skript] Installed dependencies: 
[11:10:28 INFO]: [Skript]  - Vault v1.7.3-b131

(built from dev/feature)

Bug Description

Im not really sure what is going on here, but having 2 loops (not nested) and a spawn section in the first loop, causes the second loop to think there's multiple loop values.

two issues here:

  1. if you use loop-value you get the "There are multiple loops that match loop-value. Use loop-value-1/2/3/etc. to specify which loop's value you want." error
  2. if you use loop-value-1/2, the first value is null

Expected Behavior

Not to error, and loop-value to work as it did in previous versions.

Steps to Reproduce

run the following code:

on load:
	set {_e::*} to "a", "b", "c"

	loop {_e::*}:
		spawn sheep at event-location:
			set {_e} to event-entity

	loop {_e::*}:
		broadcast "loop-value: %loop-value%"
		broadcast "loop-value-1: %loop-value-1%"
		broadcast "loop-value-2: %loop-value-2%"

Outcome:

[11:14:06 INFO]: Line 11: (test.sk)
[11:14:06 INFO]:     There are multiple loops that match loop-value. Use loop-value-1/2/3/etc. to specify which loop's value you want.
[11:14:06 INFO]:     Line: broadcast "loop-value: %loop-value%"
[11:14:06 INFO]:  
[11:14:06 INFO]: loop-value-1: <none>
[11:14:06 INFO]: loop-value-2: a
[11:14:06 INFO]: loop-value-1: <none>
[11:14:06 INFO]: loop-value-2: b
[11:14:06 INFO]: loop-value-1: <none>
[11:14:06 INFO]: loop-value-2: c

Errors or Screenshots

No response

Other

No response

Agreement

  • I have read the guidelines above and affirm I am following them with this report.