ServiceProvider

Show Deprecated
Not Creatable
Not Browsable

A ServiceProvider is an abstract class, which stores, and provides certain singleton classes, depending on what inherited class you are using its members with.

Summary

Methods

  • Write Parallel

    Returns the service specified by the given className if it's already created, errors for an invalid name.

  • Returns the service with the requested class name, creating it if it does not exist.

Events

Properties

Methods

FindService

Write Parallel

Parameters

className: string

Returns

Code Samples

ServiceProvider:FindService

print(game:FindService("Part"))
--> nil
print(game:FindService("Workspace"))
--> Workspace

GetService

Parameters

className: string

Returns

Code Samples

ServiceProvider:GetService

local BadgeService = game:GetService("BadgeService")
local GameSettings = UserSettings():GetService("UserGameSettings")
print(BadgeService)
print(GameSettings)

Events

Close


Code Samples

ServiceProvider.Close

local function onClose()
print("The place is closing")
end
game.Close:Connect(onClose)

ServiceAdded

Parameters

service: Instance

ServiceRemoving

Parameters

service: Instance