I don't understand what I did wrong with the module script

Before saying my problem I will post the code that does not work.

DebugDictionaryScript(Module)

local DebugDictionary = {

–Services

Workspace = game:GetService(“Workspace”),

Players = game:GetService(“Players”),

CoreGui = game:GetService(“CoreGui”),

Lighting = game:GetService(“Lighting”),

ReplicatedFirst = game:GetService(“ReplicatedFirst”),

Lighting = game:GetService(“ReplicatedStorage”),

ServerScriptService = game:GetService(“ServerScriptService”),

Lighting = game:GetService(“ServerStorage”),

ServerStorage = game:GetService(“StarterGui”),

StarterPack = game:GetService(“StarterPack”),

StarterPlayer = game:GetService(“StarterPlayer”),

SoundService = game:GetService(“SoundService”),

Chat = game:GetService(“Chat”),

LocalizationService = game:GetService(“LocalizationService”),

TestService = game:GetService(“TestService”),

MarketplaceService = game:GetService(“MarketplaceService”),

LocalPlayer = game.Players.LocalPlayer,

–Eventos

PlayerAdded = game.Players.PlayerAdded,

–Levels

Debugers = {“funtimeandrefoxy”,“Player1”,“Player2”},

Test1 = {},

Test2 = {},

–Locations

DebugMaster = script.Parent.Parent.DebugMaster

}

return DebugDictionary

DebugFuctionScript:

local module = {}

DebugDictionary = require(script.Parent.DebugDictionaryScript)

function test()

end

–[[private code]]

return module

DebugServerScript(Server):

local DebugDictionary = require(script.Parent.DebugDictionaryScript)

DebugDictionary.test()

My problem is that it will give a null error in the line “DebugDictionary.test ()”, I think the problem is in this line in not containing anything in the parentheses only that I don’t know what I should put.
Any way to make this part work? (I’m still new in this part so I have these doubts)

Standard responses:

  • Please put your code between ``` (Three backticks / grave accents) for readability.
  • Please state what you expect your code to do.

From what I can tell, your test() function is not in the DebugDictionary table. Maybe
you want?:

DebugDictionary.test = function()  --[[ Whatever here ]]  end
2 Likes

Well first, please use codeblocks:
```lua
–code
```

The problem is you are not declaring test function in the “DebugFuctionScript”,

function DebugFuctionScript.test()

end

and you are requiring the wrong module DebugDictionaryScript instead of DebugFuctionScript
Your post is very confusing and there might be another error.

1 Like

ok convince i made the prey but i will say what i want
DebugDictionary = fetch locations or events to not always write long lines
DebugFuctons = Stores all the functions you created and uses DebugDiciotnary to make lines short
DebugServerScript = is where I put the functions that are in debugfunctions with the help of debugdictionary.

What I want to do: As seen the function test () should print what is in DebugFunction only that it does not and gives a null error, some way to make it work?

again lack of attention and I never realized how to do functions in module scripts, thanks.