as of right now I have a module script with a table place in starterplayerscripts, this stores default and saved player data, and a script in server script service. But I’m struggling writing the rest of the game out because the module and server script are unable to communicate. before all this I have the server script as a local script in the player, but since I wanted to remove the chance of simple hacks, i moved to a normal script. But as i’m rewriting the script, i’m getting a lot of errors. For example, the server script is completely incapable of communicating with the module script. where should I put the scripts to solve this issue of not being able to communicate, or would I need to use something like remote functions or bindable events?
I recommend putting it in: ReplicatedStorage because the Server and Client have access, the Exploiters will have access, but if your Game hides the functions and has a lot of things they won’t even notice why no one leaves deleting everything without knowing what it is.
does it mean both or only one or the other?
ModuleScripts that needs to be visible only for server → Server(ScriptService,Storage)
ModuleScripts that needs to be visible for both server and client → ReplicatedStorage
ModuleScripts that needs to be visible only for client → StarterPlayerScripts
If you are performing client → server (or reversed) communication you should “only” use RemoteEvents or RemoteFunctions.
My game is setup so that it just tracks progress of the player, hence giving rewards etc. so It would need to be on a script, and I also have my script for changing values in the module script.
What I’m getting from this basically is that I will basically have to use remote events to communicate from server to client and vice versa.
You can also use something on style of “leaderstats” but with attributes and hook changed event to it. But that’s up to you.
alright I think what im gonna do is use remote events and just pass arguments for all my information, I think that should be a decent solution