Module scripts not changing

So i was working on a system for storing inventory data and i ran into this problem:

-- Module script

local module = {
    Data = {}
}

return module

There is an empty table named “Data” in this module script.

-- First script

local Data_Module = require(script.Parent.Data_Module)

Data_Module.Data["Money"] = 101
print(Data_Module.Data.Money) --prints 101

This works fine so far.

-- Second script

local Data_Module = require(script.Parent.Data_Module)

print(Data_Module.Data.Money) --prints nil

The data only changes for the script that changed it.

I really don’t know how to solve this problem. If anybody here could tell me how to make the module change across scripts, it would be very helpful.

The reason for that would be that the second script is running before the first script, so it is a race condition. A few solutions would be to yield a bit to give the first script time, or running that code later on such as when an event fires.