Module script in ReplicatedS Storage to store data

Hello, I had a question about the data being stored in a module script. If I were to have a system that would dynamically be creating/deleting/editing some data, if I were to put this into a module script in replicated storage that the client and server could both access the same information? Basically what I want is a party system where players would be able to create/delete parties, add members etc. and I want both the client and server to access the same data. Would it be better for me to put all that dynamic data in a module script/table, or if I should use a module script to create folder instances etc. in replicated storage for the same thing

1 Like

Given your requirements for a party system where both the client and server need access to the same data, using a module script with a table in ReplicatedStorage seems like a more straightforward and efficient option. It simplifies data management and ensures that changes are synchronized between all players.

Just make sure to properly handle data validation and security to prevent exploitation. Remember that the client can’t (or shouldn’t be able to) modify data directly. You’ll need to make use of RemoteEvents or RemoteFunctions if you want the client to modify data.

Module scripts can be required from both the server and client… but it’ll create a new copy for the server and any clients. So the server can change a value but all clients wont have access to it… same with if a client changed a value and a different client or the server tried to access that changed value. You could use a module script and then require it on the server and let the client send events to change and get info from the module.