GetService
Finds a top-level service by class name.
Syntax
:GetService(className: string) -> Instance
Parameters
| Parameter | Type | Description |
|---|---|---|
className | string | The Roblox class name to match. |
Returns
| Type | Description |
|---|---|
Instance | Instance? |
Description
GetService is part of the Instances library. Instances are live proxies backed by game memory. Property reads and method calls go through Roblox's own objects.
The call is read-only: it resolves the current value when invoked and does not change the underlying state.
Example
local players = game:GetService("Players")
print(players)
Notes
- Instance proxies are backed by live game memory.