Weird Module Error

Hey developers, I am working with my own game framework, and whenever I tried to run this function, I get this error:

Module:

function KoolServer:AddServices(directory: Instance)
		
		assert(typeof(directory) == "Instance", OutputFormat:format("Argument #1 must be an Instance"))

		for i, module in pairs(directory:GetChildren()) do

			if module:IsA("ModuleScript") then

				require(module)

			end

		end

	end

Script:

Kool.AddServices(game.ServerStorage.Services)
Kool.AddModules(game.ReplicatedStorage.Modules)

You’re calling the module using a period operator.
Use a colon. There’s alot more going on behind the scenes, in short by using the period operator you’re setting the self argument.

It should be;

--  v [It's different]
Kool:AddServices(game.ServerStorage.Services)
Kool:AddModules(game.ReplicatedStorage.Modules)
1 Like

Sorry for the late reply, I tried it out and it works. Thank you so much!