I come from Unity 3D, where it's encouraged to use different scripts for different purposes. Such as one script may handle game mechanics, one may handle user's stats, etc. In this environment, you can access members and properties of different classes, but I'm seeing that the only way to do this in Roblox/Lua is with modules or something similar.
Therefore, my question is, should I handle most, if not all, of my server actions in a single script? How am I expected to access members of one script from another? Do most people just slap on some IntValues, ObjectValues, etc. and read from those? Is this not exposing the client to potential exploits?
I'm very new to Roblox's coding environment, so I hope you understand where I'm coming from, it's just strange to feel as if it's limited in the sense that there isn't much access between different components
Thanks

6 comments
I feel the more instance values you add. The clunkier and more hacky your code becomes.
Thanks Griffi0n, what do most people do then? I don't feel like most of these projects are built with 5000 line server scripts!
I don't think you are able to do all (or most) of your code in one server script(due to network filtering, you must communicate between the server and client and vice versa based off of your game code). For example, you have a touched event, would you rather do that in a separate server script or would you rather put it in a server script containing all of your game logic.
saSlol2436 I understand that, but what I don't understand is how am I supposed to communicate with other scripts when Roblox doesn't give you the option to call functions on other scripts without using _G or modules?
I think what you are referring to other script without using _G or modules is like a public variable, public class or public function etc. The only option you can pretty much use are _G,shared,BindableEvents and/or BindableFunctions, or module scripts to communicate between scripts.
We can discuss via scripting helpers chat @Firedan1176