Service Creator V2

Service Creator V2

AlsoPluginIcon

Plugin | Module | Source Code

Service Creator is a 2 part package. The first is the plugin and the second is the Module you can use the module without the plugin but it does make it easier with the plugin. It uses custom methods for instances to work so big shoutout to @Mega_Hypex .

Now before anyone asks I know using _G is bad practice but it was the only way I could think of making it easily accessible anywhere.

How to use:

Installing:

First thing you want to do is get the plugin and module which are linked at the top then put the module anywhere you want however server storage is recommended

Creating Services:

Making with plugin:

To create a service with a plugin what you need to do is open it up then press create.

That should take you to a screen with code on the bottom half and an empty box on the top

All you have to do is enter a name and that’s it. You can change the code if you want but it is editable in the module itself.

After you press create

it should look like this.

Oh and if you don’t have the module installed then it will warn you in the output
image

Making with Module:

So to start the module all you need to do is require(--path to module):Start() and with that it can be access anywhere on a server script with _G.Servicer. So now to actually create it just do _G.Servicer:CreateService(--Name of Service, --Module script that service runs) and now the service is running.

Using the Service

So if you haven’t already what you want to do is start it by doing require(--path to module):Start() then it can be accessed anywhere on a server script with _G.Servicer.
Then to get it just do _G.Servicer:GetService(--Service name") it can also call normal services like players.

Pros and Cons:

Pros:

  • Easy to access
  • Allows you to have more choice of how you game runs
  • Easy to use

Cons:

  • Could be exploitable (I have yet to test this)
  • Uses _G which is bad practice
  • Coding the module scripts can be confusing

The End

All right that’s it I think. If you have any feedback or questions please put them below as this is my first time making a proper module and plugin. Hope you enjoyed it :slight_smile: and if you would make me very happy if you could heart it.

1 Like
  1. you spelled “updater” wrong,

  2. You can use ModuleScripts for making it accessible anywhere, require() is useable anywhere, in server and client, _G has race conditions and backdoors

  1. your account isn’t ID verified, so it’s hard to find your plugin by the toolbox as roblox recently changed the way it works because people were putting inappropriate models inside boxes to bypass moderation, and roblox states that non id-verified users are most likely posting malicious content, but the source code is safe (you didn’t make a github repository and I use betteroblox extension so I can see the source coce)

image

3 Likes

Do you mean updater in the code? Also should I link a repo for the source code?

  1. no, the “updater” in the UI as the picture you showed
  1. yes, not everyone is in PC to use it, and not everyone is sure if it’s safe or not, also please use GitHub, not any other repository creation thingy :slight_smile:

oh in the picture I’m English not American so for me that is how you spell it also will get to making a repo

1 Like

Why bother using this when I could just use normal ModuleScripts? ModuleScripts are already a singleton, this is just unnecessary.

local TesterService = {}

function TesterService.DoSomething()
    print("Hello world!")
end

return TesterService
local TesterService = require(PathToService)

TesterService.DoSomething()
2 Likes

I know but if I have a module say 5 folders deep it’s just a pain trying to get everything whereas with this its like a roblox service and easier to get to.

If that’s the case you have an organization problem, accessing everything in a global environment is 1000x worse, no types, easy to overwrite, and prone to race conditions.

“For every use of _G, a baby zebra dies” - Sleitnick, Creator of Knit

5 Likes

Well rip the baby zebras. But then do you have any other ways to make it easy to access?

1 Like

If you want to do it similar to the way roblox does it then make your own game class:

type ServicesIndex = "TesterService" | "PrintService"

local MyGame = {}

function MyGame:GetService(serviceName: ServicesIndex)
	return require(PathToServices[serviceName])
end

return MyGame

This is still not ideal, as you have to define every service in the service index type after you create it, and I’m pretty sure you won’t get types for the service you get, but its a slightly better solution. I would still recommend using plain ModuleScripts though.

2 Likes

Uhh I am not familiar with the type keyword could you explain what it does?

The type keyword allows you to define your own custom types.

type Person = {
    name: string,
    age: number,
}
3 Likes

:skull: :skull: everything is true except backdoors

1 Like

just to clarify i meant it was easier for backdoors to destroy your game once something was injected. _G does not have backdoors preinstalled.

2 Likes

There is a workaround for messy paths for modules

return function(name:string)
   return require(script:WaitForChild(name))
end

however, please do not name them the same way, it’s common sense, also have no types which is another issue

1 Like