Module script or Values

Hello!
I was wondering which one is better to store data. Modules scripts or Values. While both have their own features I don’t know which one would be better to store data(Game data not player data).

1 Like

I think modules are better because modules can store more information such as functions and tables.

Module
local module = {}

module.numbers = {1,2,3}

function module.alert(str)
	warn(str:upper() .. "!")
end

return module

Values can only store strings, numbers and objects. There are most likely more things they can store, but the point is, modules can store all these values and more. Modules are also better because if I wanted to store multiple different values, I could store all those values in one module script. You’d need a new value for each value you want to store.

1 Like