Lot of trouble with serverside Lua

I keep on getting

too many C levels (limit is 200)

and honestly, I am not sure what to do about it, it’s all stuff that work work in beamNG, but I feel like it isn’t working properly on the server-side environment, I can provide code snippets, but I am honestly not sure what i’m doing wrong. since I honestly don’t know a lot about what this error actually entails.

edit: It really only occurs when I do a key-value loop and when I get the error, I always get two at a time both pointing to separate parts of the script.

edit: I managed to get it to stop freaking out, it seems to be caused by a require() loop, which I don’t think should have been a possibility, seeing as require was only supposed to create a new instance if one did not exist, but, nonetheless, I fixed it, but I still feel like I am walking on eggshells.

I have actually narrowed down the problem, require() always creates a new instance regardless of if one exists, and secondly, modules are not working at all, you have to do some complicated work around to make them work otherwise you can’t access other modules

@Anonymous275 can you look at this please.