I am trying to get variables from a Module script to a script. This is my first time using module scripts so I'm having a bit of a difficulty. When I try to print out the value that I'm getting from the module script, it is nil. The module location is inside two folders, WeaponModule and Module, which is inside the ReplicatedStorage.
Module Script
local module = {
{
["Damage"] = 100, ["MagazineSize"] = 5, ["ReloadSpeed"] = 4, ["ShotDelay"] = 1
}
}
return module
Script
local wepModule = game.ReplicatedStorage.Module.WeaponModule[toolName]
local wepTable = require(wepModule)
print(wepTable["MagazineSize"])
toolName is a variable passed through a function that is just a name of a tool. I have a bunch of modules planned for each weapon.

3 comments
Try doing :FindFirstChild(toolName) or :WaitForChild(toolName). There is a chance that it might not be able to find it properly. Also with any kind of dictionary, you can index anything that has no spaces with something like wepTable.MagazineSize
Functionally, both are the same. tab.index is merely syntax sugar for tab[index], though the former only works if the index is a legal identifier
I've confirmed that toolName is being found correctly. Thanks for the tips about the dictionary.