Yuari
Documentation
Docs/Instances/GetService

GetService

Finds a top-level service by class name.

Syntax

:GetService(className: string) -> Instance

Parameters

ParameterTypeDescription
classNamestringThe Roblox class name to match.

Returns

TypeDescription
InstanceInstance?

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.