Editing a modules data

so, let’s say I have a module like this:


local data = {
     ["foo"] = 0.4,
     ["bar"] = true

return data

and then I would like to set the whole table into something else like

local newData = {
     ["foo"] = 584,
     ["bar"] = false

how would I change data into newData with a script, without changing value by value? I’m sorry if this is beginner question, I’m just rather new to tables and such.

1 Like

Can’t you just overrwrite this by either data = newData and vise versa?

is that possible if data is in a module? and I just do it like this:

local module = require(path.to.module)
module = newData

Yeah you just require the module, and access whatever is inside like so:

local module = require(path)
module.Data = module.NewData --##and vise versa

oh, I didn’t think it was that simple. well, thank you for your assistance!

1 Like