It doesn’t yield if I don’t require it from that extra localscript, but does if I do. Which is very odd.
I mean a loop of requiring. For example, 1 to 2 to 3 to 4 to 1.
Say we have module a and b. If a requires b, and b requires a, we have a infinite loop.
I fixed it by requiring the modules in the LocalScripts only, and I put the required module the functions needed as an argument when I called the necessary functions from the module.
This stopped the infinite yield as @Faultsified was talking about.
Thank you all for the help and the ideas!
Just a reminder, mark the solution when done.
Already did the second I posted it.
Had to refresh, sorry…
In order to avoid cyclic requiring in the future, I would suggest writing/using a standardized codebase, or “framework”.
https://devforum.roblox.com/t/how-did-you-organize-your-games-framework-show-us/230000
https://devforum.roblox.com/t/what-type-of-framework-do-you-use/51380