If I change a value in a module script for the server, local scripts that use the module script will also get that change?

Title pretty much says it all. I’m making a table in my module script for certain players and I want all my scripts to access it.

1 Like

No.

(Use Attributes or Values.)

2 Likes

That’s not possible due to how roblox handles server and client side model.
When server script requires module script, it gets required in server side, which means only sever can access that specific required module script.

That’s the same for the client. Everything LocalScript requires, only the client can access the same required module script.

  1. You can use Remote Event and with Server script fire to all clients when value gets changed in the module script.
  2. You can use Remote Function and with LocalScript whenever a client needs to update its module script, sends to server that returns the updated module script.
  3. Or I would recommend you as @Judgy_Oreo said, use attributes or values stored in ReplicatedStorage so both server and client access.

I hope I was useful. If I have a mistake, you have a question or something else, feel free to reply :slight_smile:

2 Likes

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