When I try calling a table from a ModuleScript it gives me the “Attempted to call a table value” error, here is the part where It’s messing up:
for _,v in pairs(module.adminIds()) do
and here is the module part of the script:
--Script
local module = require(script:WaitForChild("Admins"))
for _,v in pairs(module.adminIds()) do
print(v)
end
--ModuleScript
local Admins = {
adminIds = {140800699}
}
return Admins
As Hellnickell said, remove the (). There’s no reason that should be there unless it’s calling a function and needs parameters.
Also you should have your module like this:
local Admins = {
["adminIds"] = {140800699}
}
return Admins
or
local Admins = {}
Admins.adminIds = {140800699}
return Admins
(Idk why but not putting “[”" or “”]" always created problems, it was a while ago that I tested it though so )
Edit: I meant arguments, I always confuse the 2. Argument is the values you provide, parameters are the values the function uses that you’ve provided as arguments.