so I use a module and a local script for a tower spawning and attacking system. Now I decided to use the module inside the local script for OOP (Object Oriented Programming) so I can transfer certain values from the module to the local script.
For some reason, the module starting running on the client (I’m guessing that’s the issue), now this wasn’t a problem before and it pretty much fixes itself if I just don’t require the module but I pretty much need the module for this.
Modules cannot execute their own code. If you require the module on the client, it will run on the client. This is causing your issue when you attempt to connect OnServerEvent on the client.
I’d recommend removing any server-only code, basically holding two different copies. Be careful, if you leave server only code in the client module, exploiters could decompile it and look for weak points in your code, making it exploitable and they may be able to force errors server-side, causing issues.