Table returns nil (only in Clients)

Greetings, the issue I’m facing is that when I try to retrieve the table from a client script, it just returns nil in client scripts but not in server or module scripts.
This is how the code looks: (moduleScript for establishing the table)

The client script that retrieves the table details looks like this:

Finally, this is the communicationService module found in the replicatedStorage:
image

Here is when I output the results to compare between the GUID found in moduleScript and the GUID under localscript:

The ‘nil’ is for moduleScript’s GUID and second is the one found under localscript.
Also, the table in moduleScript is always empty “{}” (from Client only)

I’m developing a GUID system that looks for changes made by a module script in the server and in the client script located in ReplicatedStorage to run some functions and services. This is basically the simple security, but I’m also planning to add some more security measures (such as RSA, and etc) once I fix this issue.

Hey @LunaTech, good evening, I’ll try to help you as much as I can, but I can’t promise a “good” or “definitive” answer because there might be lots of different causes :sweat_smile::

so when you’re working with module scripts and data sharing between the server and client, it’s important to understand that the server and client each have their own separate instances of the ModuleScript;
this means that any changes made to a table within a ModuleScript on the server will not automatically be reflected on the client, and vice versa

if a table is returning nil or is empty on the client, it’s because the client is accessing a different instance of the ModuleScript than the server, and the table hasnt been populated on the client side

to sync data between the server and client, you can try Remote events or Remote functions.

i hope that this helps you, and can you try to update your scripts with this knowledge and let me know of any errors, thanks! :smile:

2 Likes

For real. That’s the only solution to it.

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.