Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

How does single-script architecture work with Local scripts?

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

✓ Accepted answer

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.

3 comments

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!

0

Oh I see what you mean. Yeah, don't do that, lol.

0

could you clarify a bit on the remote events/functions a bit please. Sorry to bother you I am just trying to learn.

This discussion is preserved as it was. New answers, comments, and votes are closed.