Glorpia Docs
Services

ServerScriptService

A protected server-side hierarchy service for authoritative ServerScripts and other stored instances.

Access

Luau
local ServerScriptService = game:GetService("ServerScriptService")

print(ServerScriptService == game.ServerScriptService)

Security

NameTypeDescription
LoadStringEnabledbooleanDefaults to false. When enabled in Studio, public ServerScripts may use loadstring(). LocalScripts remain blocked.

LoadStringEnabled is configured in Studio Properties and saved with the place. Creator scripts cannot change it at runtime.

Keep LoadStringEnabled disabled unless a game specifically requires dynamic server-side Luau compilation. Code compiled by loadstring() keeps the same public ServerScript environment and permissions as the script that compiled it.

ServerScript execution

Enabled creator ServerScript instances under ServerScriptService are discovered by the authoritative server and start once when they become runnable.

NameTypeDescription
Enabled ServerScriptexecutes onceRuns as public creator server code when discovered under ServerScriptService.
Runtime-created or moved ServerScriptdiscoveredAn enabled script starts once after it enters a valid server execution location.
Client replicationexcludedThe ServerScriptService tree is not included in normal client replication.
ServerScripts under Workspace follow the same discovery rule. ServerScripts stored under ServerStorage, ReplicatedStorage, StarterGui or StarterPlayer remain dormant there.

Hierarchy API

The service root is protected and cannot be renamed, destroyed, dragged, or reparented. Supported instances can be inserted or parented beneath it.

NameTypeDescription
FindFirstChild(name, recursive?)methodFinds a child by name.
FindFirstChildOfClass(className)methodFinds the first direct child with the exact class name.
GetChildren()methodReturns direct children.
GetDescendants()methodReturns every descendant.
IsA(className)methodChecks the service class or Instance base class.
GetFullName()methodReturns ServerScriptService.

Example

Luau
local ServerScriptService = game:GetService("ServerScriptService")
local scripts = ServerScriptService:GetChildren()

for _, child in ipairs(scripts) do
    print(child.Name, child.ClassName)
end

Related