Glorpia Docs
Instances

LocalScript

Public creator-authored Luau that runs on each Glorpia client.

Availability

NameTypeDescription
Execution contextclientEnabled LocalScripts run when they exist inside the local PlayerGui, local PlayerScripts, or the local Player's Character.
Studio insertionavailableInsert LocalScript anywhere in Explorer. Template or invalid locations remain inactive until a runnable runtime copy/context exists.
Instance.new()supportedInstance.new("LocalScript") creates the hierarchy object. If it is enabled and enters a valid local runtime context, it starts once without restarting existing scripts.
EnabledbooleanRead/write local hierarchy property. Enabling an unstarted LocalScript in a valid runtime context allows it to start on the next runtime script scan.
script globalavailableInside the script, script refers to that LocalScript instance.
LocalScript uses the public client permission set. It does not receive the privileged permissions of CoreLocalScript.

Starter templates and runtime copies

StarterGui, StarterPlayerScripts and StarterCharacterScripts are template locations. LocalScripts stored in those template trees do not execute there.

When the engine creates the local PlayerGui, PlayerScripts or Character, the corresponding LocalScript copies become runnable. Respawned character copies receive new runtime IDs and start once for that character.

Client-only APIs

LocalScripts can use client APIs such as UserInputService, RunService.RenderStepped, Players.LocalPlayer, workspace.CurrentCamera, RemoteEvent:FireServer(), RemoteEvent.OnClientEvent, RemoteFunction:InvokeServer() and RemoteFunction.OnClientInvoke.

ServerScriptService and ServerStorage are server-only. Public LocalScripts cannot request or directly access those services.

BasePart.Touched is available to LocalScripts and is evaluated against that client's replicated/local world. Changes made by its LocalScript callback stay client-local unless the script explicitly sends data to the server through a RemoteEvent or RemoteFunction. Authoritative Humanoid mutations such as Humanoid:TakeDamage(), Humanoid:MoveTo(), Humanoid:FollowPlayer(), and writes to Health, WalkSpeed or JumpPower remain server-only.

Example: client input

Luau
local UserInputService = game:GetService("UserInputService")
local Players = game:GetService("Players")

print("Running for", Players.LocalPlayer.Name)

UserInputService.InputBegan:Connect(function(input)
    if input.KeyCode == Enum.KeyCode.Space then
        print("Space pressed on this client")
    end
end)

Related