Hello, I am making some kind of “instructions” system for modules.
Basically this is my trouble;
When I do this:
print(yes)
It returns nil for some reason
But this works perfectly fine;
It returns this;
This is the trouble:
The module runs properly when it’s called
This is “hell” module:
local x = {
Create = {
}
}
for i,v in pairs(game.ReplicatedStorage.Models:GetChildren()) do
table.insert(x.Create,v.Name)
print("ok..","adding",v.Name)
end
return x
Module is “Hell”, correct?
and Hell.Module is returning nil since inside the hell module, there is no “Module”.
If you changed it to Module.Create, it would return that create table.
from what I am getting from this, sorry if I am wrong.
Module = require(script.hell)
Then when you try and do Module.Module. you are trying to index “Module” inside of script.hell, not module. But “Module” is not in the hell script… so it returns nil.
nil.Create then errors. in your console, when you print yes. it says yes is nil.
local yes = Module.ModuleImCalling
print(yes)
print(yes.Create)
“ModuleImCalling” code:
local x = {
Create = {
}
}
for i,v in pairs(game.ReplicatedStorage.Models:GetChildren()) do
table.insert(x.Create,v.Name)
print("ok..","adding",v.Name)
end
return x
local yes = Module.Module
Module.Module is nil, as you printed. Inside of the table returned by Module, there is nothing called Module. I only see a Create. In your test module, I see a button, Create, Buttons, and Close, but still nothing called Module