Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
1

How does single-script architecture work with Local scripts?

Asked by 5 years ago

So someone helped me out when to use module scripts but I was wondering how module scripts could work with a local script. First, how would I pass the player to the module scripts if I was just requiring them and even if I was using functions in the module script to which I could pass the LocalPlayer, wouldn't that be exploitable? Also someone mentioned that I should use remote events/functions for client and server communication but how would I be able to use those in a single-script architecture with module scripts? Hope you guys can help. Thanks!

links to where people said what I mention in the question:

link1

link2

1 answer

Log in to vote
1
Answered by
Avigant 2374 Moderation Voter Community Moderator
5 years ago

You don't need to pass the player at all, ModuleScripts get executed by the script they are required by, so if required by a LocalScript or, recursively, by a ModuleScript required by a LocalScript, they can do anything the client would normally do.

There is no difference in the level of security between using modules and not using them.

Remotes would be used just like normal in modules that it'd make sense to respond to them from.

0
What I meant was passing parameters to the function inside the module script throught the Local script would be bad for security right? Anyway thanks! User#21908 42 — 5y
0
Oh I see what you mean. Yeah, don't do that, lol. TiredMelon 405 — 5y
0
could you clarify a bit on the remote events/functions a bit please. Sorry to bother you I am just trying to learn. User#21908 42 — 5y
Ad

Answer this question