Open Budgo opened 1 month ago
I'm pretty sure this is intended. Below is my warning when trying your code. I don't think functions allow waits.
> sk reload test
[15:12:55 INFO]: [Skript] Reloading test.sk...
[15:12:55 INFO]: Line 3: (test.sk)
[15:12:55 INFO]: A return statement after a delay is useless, as the calling trigger will resume when the delay starts (and won't get any returned value)
[15:12:55 INFO]: Line: return all blocks within {location1} and {location2} + {num1}
[15:12:55 INFO]:
[15:12:55 INFO]: [Skript] Encountered 1 error while reloading test.sk! (25ms)
Probably related to https://github.com/SkriptLang/Skript/issues/4005
This has been a known issue for a long time but I don't think there is a issue for it.
Essentially sometimes the error works and sometimes it doesn't. There is a condition that makes the error happen and other times it doesn't. Probably when it's not on the main thread or not on the same event scope.
It should always error.
The error difference is due to skript-reflect registering a different return effect and a different error.
The error difference is due to skript-reflect registering a different return effect and a different error.
Oh I remember now.
So skript-reflect should error if it's not in a custom syntax element, and do so silently, because if it uses Skript.error in the init, Skript won't continue onwards with checking other elements.
Which is what is happening here.
Skript/Server Version
Bug Description
Let's say we have a function x defined as follows:
Upon reloading the Skript containg the function, the error "The return effect can only be use in functions, custom expressions, sections, custom syntax parse sections, and custom conditions"
Expected Behavior
I expect the Skript to reload with no errors.
Steps to Reproduce
Create a new Skript file. Paste the following:
Save, then reload the Skript.
Errors or Screenshots
No response
Other
No response
Agreement