Public Scripts
Creator ServerScripts and LocalScripts with separate authoritative-server and client permission sets.
Execution
| Name | Type | Description |
|---|---|---|
ServerScript | server | Enabled ServerScripts under Workspace or ServerScriptService start once when discovered by the authoritative server. |
LocalScript | client | Enabled LocalScripts start once inside the local PlayerGui, local PlayerScripts or the local Player's Character. |
CoreScript / CoreLocalScript | engine only | Glorpia-owned privileged scripts. Creator scripts do not receive core permissions. |
script | global | Inside either public script class, script refers to the currently running script Instance. |
Client and server permissions
| Name | Type | Description |
|---|---|---|
UserInputService | LocalScript | Client keyboard, mouse and cursor APIs. Requesting it from a public ServerScript is rejected. |
RunService.RenderStepped | LocalScript | Client render-frame signal. Public ServerScripts cannot connect to it. |
Players.LocalPlayer | LocalScript | The current client Player. It is nil in public ServerScripts. |
workspace.CurrentCamera | LocalScript | The current client Camera. Public ServerScripts see no CurrentCamera. |
ServerScriptService / ServerStorage | ServerScript | Server-only services. Public LocalScripts cannot request or directly access them. |
loadstring() | ServerScript | Disabled by default. Available only when ServerScriptService.LoadStringEnabled is enabled in Studio. LocalScripts cannot use it. |
Workspace / Players / Lighting / ReplicatedStorage / TweenService | both | Documented shared services available in both public contexts. |
BasePart.Touched | both | ServerScripts 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 writes | ServerScript | LocalScripts may read replicated values but cannot mutate these authoritative properties. |
ServerScript.Enabled writes | ServerScript | Public LocalScripts cannot change a ServerScript's Enabled property. LocalScript Enabled changes stay client-local. |
Humanoid:TakeDamage() | ServerScript | Authoritative damage is server-only. Humanoid.Died remains observable on both sides. |
Humanoid:MoveTo() | ServerScript | Authoritative NPC movement targets are server-only. |
Humanoid:FollowPlayer() | ServerScript | Continuous 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
-- LocalScript
local event = game.ReplicatedStorage:WaitForChild("ActionEvent")
event:FireServer("JumpButton")-- 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
-- ServerScript
local getRound = game.ReplicatedStorage:WaitForChild("GetRound")
getRound.OnServerInvoke = function(player)
return 3, "Playing"
end-- 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.