What features would you want in an API?

Development discussion isn’t the right category. This should go in Help and feedback.

I disagree with making those if they are “Simple”. Hundreds of them already exist and little to no one uses half of them. Only a few stand out. Though, if you are experimenting with it, don’t hesitate to continue!

1 Like

But things like datastores are difficult to people who are new to development, thats why i want to implement them.

Are you sure beginners are able to use and understand how module scripts work? A million of those exist. The most prominent ones are Datastore2, ProfileService etc. And I recommend beginners to learn how to use the Roblox Api and then Datastore2 or profile service.

And doing stuff like:

function module:Set(key, value)
    Datastore:SetAsync(key, value)
end

Is what I see most ‘simple’ datastore modules do.

Well, You know game:GetService(“AnyServiceName”)

You Can Create Your Own Services Like:

API:GetService(“DataStore2”)

1 Like

For easy development, math heavy functions, I honestly suck at math and as a beginner I would of just given up had it come to math, If you create a math-targetted API, doing functions, lerping through things, mathematical things then you’ll help people out.

Another hard concept was raycasting, it was kinda tricky to understand it back then as a beginner.
But ake sure to ofer a tutorial or two from roblox whilst they develop because it will help them alot.

1 Like

That is very misleading. You cannot create new services because roblox does not allow you to do so. Datastore2 isn’t a service. Its a library/module. You can only create modules for the same that can be used using require(), not GetService().

instead, i’d do something such as

api:GetComponent("DataStore2")

Component meaning something that you created, or via someone elses code. A component helps add to the base environment.

1 Like

You can’t use modules in other scripts without require(). GetComponent() isn’t a thing as per the official api docs.

yeah but if you’re going to require a module for help, then this module can provide a getComponent function to help get components which can be utilise in actual code. Like sub-modules for a main module.

i’m talking about making getComponent a thing when you require the module lol.

  • all of my frameworks are built on modules, so :getComponent is apart of the game instance. Sorry if I was being misleading in my message :+1:
2 Likes

I think adding a shop that saves your purchases would be very helpful for beginners.
It’s a little bit annoying that it’s hard to just save simple things using Roblox datastores. :man_shrugging:

1 Like

That would be great, so ID’s being assigned to objects, then storing them in a table?

Yeah, using a table to store the ID’s would be how I would do it.

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.