GetService (Method)

From Legacy Roblox Wiki
Revision as of 04:45, 27 April 2023 by Realjame (talk | contribs) (Text replacement - "<SyntaxHighlight code="lua">" to "<syntaxhighlight lang="lua">")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigationJump to search
GetService( string className )
Returns Instance
Description: Returns the service which was requested.
Member of: ServiceProvider

Description

The GetService method returns a service that you ask it for. Send it the name of a service (such as Debris) and it will return a value of the service. Useful for hidden services. If the service you requested is valid, but does not exist, then it will create it and return it.

Example
teams = game:GetService("Teams")


List of obtainable services

Services that are specific to a single object are underlined for your convenience.

In DataModel:GetService

In GlobalSettings:GetService

In UserSettings:GetService