Module Script Server/Client Issues

image
image
image

So I have a module script in Replicated Storage that is required on both client and server scripts. I’m using remote events in order to update the module script’s tables on the server side. However, when I print these table values on both the client and server sides, the server prints that the values are either true or false, but the client prints that the values are nil like they were never set at all. If I update the values of a module script in replicated storage through a server script, shouldn’t that also update the values for all client side scripts that require it?

2 Likes

In other words, how can I send a table from the server to all clients?

This is unfortunately not true, due to the require command itself (or module scripts, I’m not really sure). When you require the module on both the server and the client, it gives 2 seperate scripts and it won’t replicate from the server to client or back. To deal with this you can just get the table from the module script on the server and send it via a remote event to all clients

What you can do is put your module script in a serverstorage, Make Changes using RemoteEvents and use Remotefunctions (be aware that Remotefunctions wait for a response from the server to continue execution) to get the table from the modulescript located in the server

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