Glorpia Docs
Scripting

Public Scripts

Creator ServerScripts and LocalScripts with separate authoritative-server and client permission sets.

Execution

NameTypeDescription
ServerScriptserverEnabled ServerScripts under Workspace or ServerScriptService start once when discovered by the authoritative server.
LocalScriptclientEnabled LocalScripts start once inside the local PlayerGui, local PlayerScripts or the local Player's Character.
CoreScript / CoreLocalScriptengine onlyGlorpia-owned privileged scripts. Creator scripts do not receive core permissions.
scriptglobalInside either public script class, script refers to the currently running script Instance.
StarterGui, StarterPlayerScripts and StarterCharacterScripts are templates. LocalScripts do not execute from those template trees; their runtime copies start after they are cloned into PlayerGui, PlayerScripts or the local Character.

Client and server permissions

NameTypeDescription
UserInputServiceLocalScriptClient keyboard, mouse and cursor APIs. Requesting it from a public ServerScript is rejected.
RunService.RenderSteppedLocalScriptClient render-frame signal. Public ServerScripts cannot connect to it.
Players.LocalPlayerLocalScriptThe current client Player. It is nil in public ServerScripts.
workspace.CurrentCameraLocalScriptThe current client Camera. Public ServerScripts see no CurrentCamera.
ServerScriptService / ServerStorageServerScriptServer-only services. Public LocalScripts cannot request or directly access them.
loadstring()ServerScriptDisabled by default. Available only when ServerScriptService.LoadStringEnabled is enabled in Studio. LocalScripts cannot use it.
Workspace / Players / Lighting / ReplicatedStorage / TweenServicebothDocumented shared services available in both public contexts.
BasePart.TouchedbothServerScripts receive authoritative contacts. LocalScripts receive contacts from the client's replicated/local world, and callback changes stay local unless explicitly sent to the server.
Humanoid Health / WalkSpeed / JumpPower writesServerScriptLocalScripts may read replicated values but cannot mutate these authoritative properties.
ServerScript.Enabled writesServerScriptPublic LocalScripts cannot change a ServerScript's Enabled property. LocalScript Enabled changes stay client-local.
Humanoid:TakeDamage()ServerScriptAuthoritative damage is server-only. Humanoid.Died remains observable on both sides.
Humanoid:MoveTo()ServerScriptAuthoritative NPC movement targets are server-only.
Humanoid:FollowPlayer()ServerScriptContinuous authoritative NPC following is server-only.

Glorpia.IsServer, Glorpia.IsClient, RunService:IsServer() and RunService:IsClient() report the actual side of the current runtime.

Studio

Explorer can insert ServerScript, LocalScript, RemoteEvent and RemoteFunction. Double-clicking either script class opens the same editable public script tab.

Autocomplete follows the selected script type: server-only services and remote members are hidden in LocalScripts when unavailable, while client-only input, RenderStepped, LocalPlayer and client remote members are hidden in ServerScripts.

Signal members such as Touched, Activated, MouseButton1Click, MouseButton1Down and MouseButton1Up are completed as :Connect() calls with the caret placed inside the parentheses.

RemoteEvent

Luau
-- LocalScript
local event = game.ReplicatedStorage:WaitForChild("ActionEvent")
event:FireServer("JumpButton")
Luau
-- ServerScript
local event = game.ReplicatedStorage:WaitForChild("ActionEvent")

event.OnServerEvent:Connect(function(player, action)
    print(player.Name, action)
    event:FireClient(player, "Accepted")
end)

Use FireAllClients(...) to broadcast from the server. LocalScripts receive server messages through OnClientEvent.

RemoteFunction

Luau
-- ServerScript
local getRound = game.ReplicatedStorage:WaitForChild("GetRound")
getRound.OnServerInvoke = function(player)
    return 3, "Playing"
end
Luau
-- LocalScript
local getRound = game.ReplicatedStorage:WaitForChild("GetRound")
local round, state = getRound:InvokeServer()
print(round, state)

ServerScripts can use InvokeClient(player, ...) with a client's OnClientInvoke callback.

Shared creator APIs

Both public script contexts use the documented hierarchy API, datatypes, task/math helpers, supported Instances and shared services. Instance.new() supports script objects, GUI objects, Lighting effects, Humanoid, RemoteEvent, RemoteFunction, BasicSound, Parts, values and containers.

Server-side world changes remain authoritative and replicate through the supported network state. LocalScript-only changes remain client-local unless sent to the server through a RemoteEvent or RemoteFunction.

Script output

print(...) writes Information and warn(...) writes Warning. During Studio Play, output from the client runtime is marked CLIENT.

Related