Scripting / Function
game:GetService()
Returns a registered Glorpia service by name.
Syntax
game:GetService(serviceName)Parameters and return value
| Name | Type | Description |
|---|---|---|
serviceName | string | Registered service name. |
return | service | The matching service object. |
error | runtime error | Raised when the requested service is not registered or is not permitted for the current script context. |
Registered services
| Name | Type | Description |
|---|---|---|
Workspace | service | World hierarchy, CurrentCamera and raycasts. |
RunService | service | Frame timing signals and runtime-state queries. |
UserInputService | service | Client keyboard and mouse input for LocalScripts and CoreScripts. |
Players | service | Player list, LocalPlayer and player signals. |
Lighting | service | Brightness and time of day. |
TweenService | service | Property animation and easing. |
DebrisService | service | Schedules Instances for delayed destruction. Debris is an alias. |
ServerScriptService | service | Server-side hierarchy for executable ServerScripts. |
ServerStorage | service | Server-only stored hierarchy. |
ReplicatedStorage | service | Shared stored hierarchy for supported replicated instances. |
game.Workspace, game.Players, game.Lighting, game.ServerScriptService, game.ServerStorage, game.ReplicatedStorage, game.DebrisService and game.Debris are also available as direct properties.Public script permissions
Public ServerScripts cannot request UserInputService. Public LocalScripts cannot request ServerScriptService or ServerStorage. Shared documented services such as Workspace, Players, Lighting, ReplicatedStorage, TweenService, DebrisService and RunService are available on both sides.
Example
Luau
local Workspace = game:GetService("Workspace")
local Lighting = game:GetService("Lighting")
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local DebrisService = game:GetService("DebrisService")
print(Workspace == game.Workspace)
print(ReplicatedStorage == game.ReplicatedStorage)
Lighting.TimeOfDay = "12:00:00"Service reference
WorkspaceWorld hierarchy and raycasts.RunServiceFrame signals and runtime state.UserInputServiceClient input state and events for LocalScripts and CoreScripts.PlayersPlayer access and events.LightingScene lighting controls.TweenServiceProperty animation.DebrisServiceDelayed Instance cleanup.ServerScriptServiceAuthoritative server script container.ServerStorageServer-only stored hierarchy.ReplicatedStorageShared replicated storage hierarchy.