What features would you want in an API?

Also, You Can Do:

Explorer:

image

Services Module:

local module = {}


function module:GetService(ServiceName)
	setmetatable(ServiceName, {
		__index = function()
			return {
				warn("Couldn't Find The Service.")
			}
		end;
	})
	for Service, _ in pairs(script:GetChildren()) do
		if ServiceName == script[Service] then
			require(script[ServiceName])
		end
	end
end

return module

Main:

local ServicesModule = require(script.Services)

ServicesModule:GetService("Example1")

Thats a bit too unnecessary…

You’ll need to require the module first, and then require the other module…

If you were working with multiple scripts, that’s so redundant. You are basically writing that whole code just to do require(path.to.module). So whats the point?

Services Managing Module Requires The Services Inside It By Using :GetService, Main Script Requires The Service Managing Module That Requires The Modules Inside The Modulescript;

I Hope You Meant It.

What even is the point to write that unnecessary code just to require a module when you can just use require()?? Thats what my point was.

Also Nevermind, Atleast It Works, That’s Just An Exmaple Not The Really Script That He Gonna do.

Thanks, Have A Nice Day.

The code is going to produce errors since the setmetatable part is incorrect. script[Service] will also produce errors. You are requiring the module script inside the function but never returning it, hence the required module can’t be used outside of the Service module.

Have a nice day.

Alright, Thanks For Correcting Me My Faults, Cya

I don’t think it’s really needed as it’s just a script of 2 lines. Again you do need to add your stuff to your leaderstats, so it’s just useless.