The return effect can only be used in functions, custom expressions, sections, .... (Skript-Reflect error)
Vulcano771 opened this issue ยท 10 comments
Skript/Server Version
Latest (2.8.2)
Bug Description
So when using the provided code Skript thinks there's an wait thingy in there - removing the teleport thing is removing the error.
When using Sk-Reflect it says that Im using a wait thing
Expected Behavior
No error
Steps to Reproduce
local function test(p: player) :: boolean:
loop {_players::*}:
teleport loop-value to {loc}
return true
people on dc said its because players::* is null but that is not tested (i guess) so i tested
local function test(p: player) :: boolean:
set {_players::*} to {_p}
loop {_players::*}:
teleport loop-value to {loc}
return true
but same error
Errors or Screenshots
No response
Other
No response
Agreement
- I have read the guidelines above and affirm I am following them with this report.
https://discord.com/channels/135877399391764480/138027100593455104/1208917960954216478
There's the context the people on discord think i'm dumb thatswhy I wrote the thing at the end, sorry
error occurs too when using global vars
e.g.:
local function test(p: player) :: boolean:
loop {players::*}:
teleport loop-value to {loc}
return true
```
It can be fixed by:
local function tpPlayer(p: player):
teleport {_p} to {loc}
local function test(p: player) :: boolean:
loop {players::*}:
tpPlayer(loop-value)
return true
```
Please provide the proper details of your /sk info
as requested in the issue report form. Also, test without any addons and let us know if that issue persists.
People say I need to use non local (https://discord.com/channels/135877399391764480/138027100593455104/1208922964641325079) but same issue
function test(p: player) :: boolean:
set {_players::*} to {_p}
loop {_players::*}:
teleport loop-value to {loc}
return true
on paperspigot, the teleport effect runs delayed and function returns can't occur after a delay. you can use force teleport loop-value to {loc}
to avoid this, but do keep in mind this will cause lag if the chunk you are teleporting to needs to be loaded/generated. @Vulcano771 confirmed on discord they are running paper
Oh Pika/Ayham what is that workarround then doing? #6444 (comment)
is that then forcing or just moving it to another thread or is skript just ignoring the delay there?