ModuleScripts run once and only once per Lua environment and return the exact same value for subsequent calls to require .
Due to this functionality of ModuleScripts by the time you require this ModuleScript it’s contents can not be altered during the runtime. So having a function that tries to randomize the return value won’t work. You would need to instead intergrate this table into the function and have that function return a value, not the module.
local module = {}
local function module.Function()
--Code
return Value
end
return module
So whenever you need this value you would just call the function.
First thing is you can’t ask someone to fix scripts for you, if you want you can hire someone. Second thing is keep your language professional, only related stuff is needed.
And about your problem, you need to look at the above answers properly.
Freaking out on a public forum is very embarrassing. Don’t do that.
When you require() a ModuleScript, it runs whatever code is contained, and then returns whatever you return at the end of the ModuleScript. The default ModuleScript contains an empty table, and then returns that empty table. When you call require(), the return value of require() is whatever your module returns (e.g. a table containing a bunch of functions declared within the ModuleScript).
You should declare the random() function in the ModuleScript as part of this table so you can access it when you require the ModuleScript. The same goes for the consonants table if you want it to be accessible when you require the module. function module.random() ... end module.consonants = { ... }
When you require a module, you only get what the module returns. If you want to access the variables in a module, you must declare those variables as members of a table that the module returns.
You should read more carefully. Your syntax is not correct as Studio is pointing out; you do not need the local on this line because module is already declared as a table, and you don’t need to declare a table member as local.
Just do module.consonants = {}
All further accesses to consonants must be done by accessing module.consonants, not consonants.