Spell Module not working, why?

I have gotten help on using module scripts for spells but it seems not work and sends out this error. Im a little stuck on what im doing wrong and why the spell isn’t working so if anyone could help I would very much appreciate it.

Error:

15:28:11.875 Activator is not a valid member of ModuleScript "ReplicatedStorage.SpellsModules.Incendia" - Client - Controller:23

local Players = game:GetService("Players")
local Player = Players.LocalPlayer
local ReplicatedStorage = game.ReplicatedStorage
local Storage = ReplicatedStorage.SpellsModules
local UserInputService = game:GetService("UserInputService")
local Spells = {
	["Incendia"] =
		{
			Launch = require(Storage.Incendia),
			Activator = {
				["type"] = "chat_message",
				["content"] = "incendia"
			},
			Cooldown = 8,
			Spell= "Incendia",
			Magnitude = 30,
			Magic = 60
		}
}


for _, spell_config in pairs(ReplicatedStorage.SpellsModules:GetChildren()) do
	local activatorConfig = spell_config.Activator
	local activatorType = activatorConfig.type

	if (activatorType == "input") then
		-- use InputBegan connection and call whenever it is appropriate
		UserInputService.InputBegan:Connect(function(input)
			if (input.UserInputType == activatorConfig.input) then
				spell_config.Launch.Execute()
				print(""..activatorType)
			end
		end)
	elseif (activatorType == "chat_message") then
		-- use player.Chatted event
		Player.Chatted:Connect(function(msg)
			if (msg == "content") then
				spell_config.Launch.Execute()
				print(""..activatorType)
			end
		end)
	end
end
return Spells

Change

local Storage = ReplicatedStorage.SpellsModules

To

local Storage = require(ReplicatedStorage.SpellsModules)

Spells modules is a folder though?

Should be Spells instead? At the moment it is the folder instance and not the table you made.

Show explorer for each spell in Spell in ReplicatedStorage.SpellsModules.

There is only one spell in the spell modules folder because im trying to test for now and see if this works but sure.

Capture0

Coming from this line. There is no child called Activator inside Incendia.

I just realized this mistake! So i moved

local Spells = {
	["Incendia"] =
		{
			Launch = require(Storage.Incendia),
			Activator = {
				["type"] = "chat_message",
				["content"] = "incendia"
			},
			Cooldown = 8,
			Spell= "Incendia",
			Magnitude = 30,
			Magic = 60
		}
}

into a module because it was actually in a local script. I required it because thats where Activator/type is but it still seems to not work

Error?

I have not gotten any errors at all

Add prints to see where the script doesn’t work anymore.

Actually no i just found an error

15:53:18.220 Workspace.Funnyskyswagway3.Controller:9: attempt to index nil with ‘type’ - Client - Controller:9

Full code?

local Players = game:GetService("Players")
local Player = Players.LocalPlayer
local ReplicatedStorage = game.ReplicatedStorage
local Storage = ReplicatedStorage.SpellsModules
local UserInputService = game:GetService("UserInputService")
local spell_config = require(ReplicatedStorage.SpellsConfiguration)

	local activatorConfig = spell_config.Activator
	local activatorType = activatorConfig.type
	if (activatorType == "input") then
		-- use InputBegan connection and call whenever it is appropriate
		UserInputService.InputBegan:Connect(function(input)
			if (input.UserInputType == activatorConfig.input) then
				spell_config.Launch.Execute()
				print(""..activatorType)
			end
		end)
	elseif (activatorType == "chat_message") then
		-- use player.Chatted event
		Player.Chatted:Connect(function(msg)
			if (msg == "content") then
				spell_config.Launch.Execute()
				print(""..activatorType)
			end
		end)
	end

Send code for this ModuleScript.

local Players = game:GetService("Players")
local Player = Players.LocalPlayer
local ReplicatedStorage = game.ReplicatedStorage
local Storage = ReplicatedStorage.SpellsModules
local UserInputService = game:GetService("UserInputService")
local Spells = {
	["Incendia"] =
		{
			Launch = require(Storage.Incendia),
			Activator = {
				["type"] = "chat_message",
				["content"] = "incendia"
			},
			Cooldown = 8,
			Spell= "Incendia",
			Magnitude = 30,
			Magic = 60
		}
}
return Spells

Try this.

	local activatorConfig = spell_config["Incendia"].Activator
	local activatorType = activatorConfig.type

No errors this time but the spell still seems to not be working