it works fine, however, when i do the same in a local script, it says "attempt to index nil with “Data”
is module script not accesible from the local script or something?
Module scripts are accessible from another script as long as it’s in the same environment as the module. So for example, if your module script is on the server, it will only be accessible from a server script. Vice versa. Also, your code snippet it very shorts but you will have to be returning the profile in your ModuleScript’s function. I’m assuming that you are but just making sure
the module script is in replicated storage, this is whats inside the manager:
local module = {}
module.Profiles = {}
return module
(im using profile service)
local script:
local changedata = game.ReplicatedStorage.Changedata
local plr = game.Players.LocalPlayer
local manager = require(game.ReplicatedStorage.Manager)
print(manager.Profiles[plr].Data.OrdersDone)