Hello,
I have a module script and when I change a value in that script on the server, and then require the module script on a client the value hasn’t changed? is it supposed to be like that and if so what’s the work around?
Here is an example:
Module:
local module = {
bool = false
}
return module
Server:
require(module).bool = true
print(require(module).bool) -- Prints true
Local:
task.wait(2)
print(require(module).bool) -- Prints false
Module scripts value wont work between client to server or server to client.
If you change a module script value through server script then it will only will work with server scripts and not with local scripts.
If you update the value with local script in module then it will only work with local scripts and not server scripts.