I’ve seen some topics talk about certain things yet I have a few doubts and I dont think I’m allowed to “bump” those topics to ask since they’re extremely old.
There will have a lot of questions I’ll bring up and I’d be happy if they were answered in one go instead of post an answer to every question separately.
It seems like exploiters can access and modify the contents in module scripts so is it a bad idea to keep them in the ReplicatedStorage? In the gameplay scripting tutorial on the documentation, the laser tag place has many modules there so I’m trying to figure out if it’s or not a good idea. Does it change only to the client? I’ve put a module script that contains the informations of certains items from the shop in the serverstorage and sent those informations to the client after they joined so they can see when they hover their mouse over the item but I’m not sure if that’s the best way or if I can simply put it on the ReplicatedStorage and let the client access to access the information directly and let the server validate the purchase by checking the same module script.
Server script with RunContext to client. It seems like it works the exact same as localscripts but anywhere and you don’t need to place it on every player for something, like open a GUI after opening the shop. It helps maintain a better organization. So my first question for this one is: When should I use RunContext client and localscript? Should RunContext be used more for things like I said earlier? Since everyone can and will access the shop I can put a single RunContext client script somewhere in said shop (inside the model or a folder in there) instead of every client having a LocalScript for it, right? What about localscript? Should it be more for things where players will have something different than the others? An example being (sorry if this example is wrong. I’m still a beginner and I dont know if that’s how it goes) two players on a competitive game. They have both their own inventory so they need a localscript in the playerscript to access their inventories and use their items, right? Also, that localscript must be in playerscript instead of characterscript so the localscript don’t “reset”? According to the documentation, scripts in the characterscript doesn’t persist when they respawn so that means they “reset”, right? My second question is: Do any of them have a certain advantage against the other or are they equally “good”?
Next question is regarding the phrase: “Never trust the client”. After scripting for a while I think I know what that means but I’m still not sure. Does that mean I always have to make the client ask for permission to the server for anything? Be it sprinting, activating one of their abilities and also collecting points?
While we’re talking about asking for permission, the other question is about remote event and functions. No, not about how they work and all that since I managed to understand. Will having a remote for everything in the game affect the game’s performance? When I say remote for everything I mean things like the 3 examples I gave earlier. I’m asking that because there can be, for example, 15+ players constantly firing those remotes. If it does, what’s the best path to take to avoid that?
I know a bit how the RunService works but what can it be used for? Everytime I search about it on the forum people kept explaining what it does but not what it can be used for. This is the only service so far that I’m rather puzzled about where and when to use it
I’m still a beginner but I’ve made quite the progress. Managed to understand the basics and also managed to do a few things on my own despite scripting only once in a while. My codes are very basic still and I’ve been thinking about stopping to script to focus more on modeling and animating. Is it a bad idea? College is making me not able to spend so much time on scripting and modeling/animating at the same time so I’m planning to get to learn those more (even though I barely started). Of course, I’ll still return after I’m satisfied with my progress but will it impact my scripting level? I mean, coding is like riding a bicycle, right? Once you learn it’s hard forget.
Those are all the questions I have for now. Thought it was better to make a single topic with all my (current) questions rather than splitting them all up. Thanks in advance