---
title: "ServerScript"
description: "The public creator-authored script class that runs on Glorpia's authoritative server."
canonical: "https://docs.glorpia.com/instances/serverscript"
markdown: "https://docs.glorpia.com/instances/serverscript.md"
---
# ServerScript

The public creator-authored script class that runs on Glorpia's authoritative server.

**Category:** Instances

## Availability

| Name | Type | Description |
| --- | --- | --- |
| `Execution context` | server | Runs on the authoritative game simulation. |
| `Execution` | available | Enabled ServerScripts under Workspace or ServerScriptService start once when discovered; connected callbacks can keep running. |
| `Studio insertion` | available | Insert ServerScript anywhere in Explorer. It remains inactive until it has a valid server execution ancestry. |
| `Instance.new()` | supported | A runtime-created ServerScript starts once after it is enabled and enters Workspace or ServerScriptService. |
| `Enabled` | boolean | Read/write hierarchy property. Enabling an unstarted ServerScript in a valid server context allows it to start on the next runtime script scan. |
| `script global` | available | Inside the script, script refers to that ServerScript instance. |

> **Note:** `ServerScript` uses the public creator API and does not receive the privileged permissions of `CoreScript` or `CoreLocalScript`.

ServerScripts can use server-only services such as `ServerScriptService` and `ServerStorage`. `UserInputService`, `RunService.RenderStepped`, `Players.LocalPlayer` and `workspace.CurrentCamera` are not available in the public server context.

## Example

```luau
script.Parent.Touched:Connect(function(hit)
    local humanoid = hit.Parent and hit.Parent:FindFirstChildOfClass("Humanoid")
    if humanoid then
        humanoid.Health = 0
    end
end)
```

## Public API

- [What public scripts can do](https://docs.glorpia.com/scripting/public-scripts.md) — Supported hierarchy, physics, sound, service and replication behavior.
- [BasePart](https://docs.glorpia.com/instances/basepart.md) — Physical properties shared by Part and SpawnLocation.
- [BasePart.Touched](https://docs.glorpia.com/scripting/events/touched.md) — Authoritative contact event behavior.
- [ServerScriptService](https://docs.glorpia.com/services/serverscriptservice.md) — Server-side container where enabled ServerScripts start once when discovered.
- [RemoteEvent](https://docs.glorpia.com/instances/remoteevent.md) — Communicate with LocalScripts.
- [RemoteFunction](https://docs.glorpia.com/instances/remotefunction.md) — Request/response communication with LocalScripts.
- [BasicSound](https://docs.glorpia.com/instances/basicsound.md) — Global and spatial sound playback.
