You can write your topic however you want, but you need to answer these questions:
What do you want to achieve? Keep it simple and clear!
I want to store simple number variables in module scripts.
What is the issue? Include screenshots / videos if possible!
Well i dont know how.
What solutions have you tried so far? Did you look for solutions on the Developer Hub?
Yeah, only for a couple of minutes though.
After that, you should include more details if you have any. Try to make your topic as descriptive as possible, so that it’s easier for people to help you!
-- This is an example Lua code block
Please do not ask people to write entire scripts or design entire systems for you. If you can’t answer the three questions above, you should probably pick a different category.
local newTable = {} -- the table variable will be saved to
local toSave = 3 -- the value of 'toSave' Variable.
local toInsert = {"ToSave", 3} -- {Variable name, Variable Value}
table.insert(newTable, toInsert) -- save 'toInsert' table in 'newTable'
-- getting the variable inside the table --
local value = newTable[table.find(newTable, {"ToSave", 3})][2]
--// Script
local MyModule = require(script.MyModule)
print(MyModule.Zombies)
Update variables like this:
--// Script
local MyModule = require(script.MyModule)
MyModule.Zombies = 7
Storing variables in modules is very similar to storing variables in a dictionary. The variables are case-sensitive, so make sure you use the same capitalization when setting and getting the variable.