Question about Safe teleport module

Hello
I am looking at the example Safe teleport module in the docs:
Safe teleport docs

In case of Enum.TeleportResult.Failure, won’t this cause multiple concurrent teleports?
(Some of them through the continued repeat/until loop and some of them through the triggered TeleportInitFailed event)?

Thanks in advance

The safeteleport function listed there attempts the teleport multiple times (see the repeat loop) until either happens:

  • a successful teleport happens
  • the amount of attempts is reached

The teleports are not done in parallel(concurrently) and thus if the teleport fails, it simply tries again for X times. If it still fails by the end of those retries, then it returns the error message.

This is clear. However after the first failed teleport handleFailedTeleport event handler can trigger SafeTeleport function again, which will cause parallel repeat/unit loop, while the first loop
is not finished yet.
or I miss something?