A service is a top-level singleton, i.e., a class that can only be instantiated once and its instance is always parented to DataModel. In Lua, service instances can be retrieved by the GetService method. Like instances, they provide interfaces in the form of members, but usually also act as containers. Services are the highest level of instances visible in the Explorer. A list of services can be found here.
Visible services[]
Some services are always shown in Explorer:
- Workspace
- A service that serves as a container for parts which will be rendered. Physics is applied to parts. Each client has its own Camera instance representing the view which is not replicated and can only be manipulated from the client.
- Players
- A service that serves as a container for Player instances, each of which represents a client.
- Lighting
- A service that serves as an interface for the lighting.
- MaterialService
- A service that serves as a container for custom materials (MaterialVariant instances).
- ReplicatedStorage
- A service that serves as a container for instances which will be shared with clients. Unlike Workspace, parts are not rendered and physics does not occur.
- ReplicatedFirst
- A service that serves as a container for instances which are replicated to the client first before other instances. Scripts will run here. It is often used for loading screens.
- ServerStorage
- A service that serves as a container for instances which will not be shared with clients.
- ServerScriptService
- A service that serves as a container for instances which will not be shared with clients. Scripts will run here.
- StarterGui
- A service that serves as a container primarily for GUI instances. ScreenGui instances parented to this service are rendered in Roblox Studio, along with GUI elements that are descendants of the ScreenGui instance. When a user spawns or respawns, instances are copied to PlayerGui. Performance-wise, it is recommended to not use this service and instead copy GUI instances from the client to avoid replication to server and ultimately to other clients.[1]
- StarterPack
- A service that serves as a container primarily for Tool instances, which will be copied to Backpack once the user spawns and every time the user respawns.
- StarterPlayer
- A service that holds two containers: StarterCharacterScripts and StarterPlayerScripts. Instances under StarterCharacterScripts are copied to the user's character whenever the user spawns and are deleted when the user is respawning, while instances under StarterPlayerScripts are copied to PlayerScripts which do not become deleted every time the character spawns. Scripts will also run in PlayerScripts. If a Model instance named "StarterCharacter" is parented to this service, it is used to spawn a user's character instead of the avatar. Similarly, if a Humanoid instance named "StarterHumanoid" is parented, the instance is copied to the character instead of the default Humanoid.
Optional services[]
These services are not visible by default but can be obtained by the Service tool:
- Teams
- A service that serves as a container for Team instances.
- Chat
- A service that serves as an interface for the in-game chat, chat filter, and bubble chat, as well as for displaying text over characters and parts.
- LocalizationService
- A service that serves both as an interface for automated translation and as a container for LocalizationTable instances.
- TestService
- A service that is designed for Roblox to run analytical tests on the engine. The service also provides an interface for facilitating running tests on a place as well as controlling run time properties of the data model in Roblox Studio, and also acts as a container for scripts which can be executed via TestService:Run; however, it is recommended to run (F8) an instance of the data model before calling the method to avoid changes on the main environment. TestService.ExecuteWithStudioRun also automatically execute the scripts when the data model is run.
- VoiceChatService
- A service that serves as an interface for voice chat.
Interface services[]
Some other services which are not visible have interfaces that extend the functionality of a place and are designed to be used by scripts.
- RunService
- A service that serves as an interface for run time properties and Task Scheduler events. It is primarily used to implement loops based on render stepping.
- Debris
- A service that serves as an interface for scheduling removal of certain instances. It is primarily used for clearing unwanted instances in the data model that would otherwise remain.
- MarketplaceService
- A service that serves as an interface for prompting purchases, retrieving product information of assets, developer products, passes and bundles and determining the user's ownership of items of any of those types. This service is primarily used for monetization.
- HttpService
- A service that serves as an interface for HTTP requests and exposes methods for manipulating JSON data. HTTP requests are blocked by default (including requests made by plugins) and can be enabled through HttpService.HttpEnabled. HTTP requests are primarily used for external web services. However, HTTP requests cannot be made to any Roblox website.
- CollectionService
- A service that serves as an interface for tags used to group instances. It is primarily used for designating a custom class of certain instances, such as parts that can kill a character upon touching which is handled by a single script.
- GroupService
- A service that serves as an interface for retrieving group information. It is primarily used for assigning users depending on if they are an ally or enemy of a group.
Cloud services[]
Certain services provide interfaces for manipulating or communication of data outside a server within an experience, known as cloud services. They have a corresponding Open Cloud API designed for third-party programs, allowing them to manipulate the data within the experience rather than from Roblox Studio.
- DataStoreService
- A service that serves as an interface for data stores which are used for storing persistent data that can be accessed from all places within an experience. Data stores are primarily used for storing player data.
- MemoryStoreService
- A service that serves as an interface for memory stores which are used for storing data that rapidly changes. Unlike data stores, memory stores are faster to access and they store data temporarily within a certain lifetime. Memory stores are primarily used for matchmaking and leaderboards, as well as caches for persistent data.
- MessagingService
- A service that serves as an interface for cross-server communication. It is primarily used for global announcements.
Special services[]
These services serve merely as methods for specific purposes, i.e., generally not suitable for implementing other systems but still can be used in a system.
- TweenService
- A service that serves as an interface for interpolating properties of instances through Tween, which supports many data types: number, boolean, CFrame, Rect, Color3, UDim, UDim2, Vector2, Vector2int16, Vector3, and EnumItem.
- UserInputService/ContextActionService
- These services serve as interfaces for user input. Many properties of user input are accessible by UserInputService while ContextActionService is used to bind user input to functions.
- PathfindingService
- A service that serves as an interface for pathfinding.
- InsertService
- A service that serves as an interface for insertion of instance data which is retrieved from the Roblox platform, such as models or accessories.
- AssetService
- A service that serves as an interface for asset related queries.
- ContentProvider
- A service that serves as an interface for preloading assets.
- PolicyService
- A service that serves as an interface for retrieving policy information about a user. It is designed for developers to have their experiences compliant with national regulations for multiple countries.
- Stats
- A service that serves as an interface for real-time performance information about the current data model, including resources and overall memory consumption.
Internal services[]
There are other services which only serve internally to be used by the engine, meaning that they do not have an interface that can normally be used by scripts. However, core scripts (scripts with elevated thread identity which can only be used by Roblox) can make use of these services. They will not be listed here as they lack official documentation and are subject to change.
References[]
Programming |
| ||||||
---|---|---|---|---|---|---|---|
Design | |||||||
Assets | |||||||
Tools | |||||||
Monetization | |||||||
Analytics | Developer Stats ยท Monthly active users (MAU) | ||||||
Advertising | |||||||
Resources |