Module Script:
local News = { ["Broadcast1"] = { -- dictionary information here }, ["Broadcast2"] = { -- dictionary information here } } return News
Local Script
local newsModule = require(script.Parent.Parent.Parent.Parent.NewsModule) local broadcasts = #newsModule print(broadcasts)
For some reason, the table always returns as 0, even though there are 2 values in the table, help.
Module scripts start with the identifier that acts like a table and returns it. Module scripts that way can be used anywhere, so for example you can use it's variables and functions everywhere.
I think that your issue here is that you didn't do it like this.
--module script local News = {} News.Broadcasts = { ["Broadcast1"] = { -- dictionary information here }, ["Broadcast2"] = { -- dictionary information here } } return News --script local newsModule = require(script.Parent.Parent.Parent.Parent.NewsModule) local broadcasts = #newsModule.Broadcasts print(broadcasts)
Tell me if it doesn't work.