Can I get a variable from a server script to another server script?

Hello everyone, I want to get a variable from a module to a server script or from a server script to a server script, how could I implement this?

I didn’t find a way in the forum or on YouTube, I decided to ask myself

You can use:

  • BindableEvents
  • BindableFunctions

Or, just use the module itself. The script can read the value or you can create a method for it.

2 Likes

either using shared tables, bindable events or _G

1 Like

It is preferable and recommended to avoid using either of all of those. Additionally, there is more or less problems with race conditions for shared and _G globals. You might consider refactoring the system later.

For Bindables, they are relatively poor in performance compared to other methods(via modules).

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