Glorpia Docs
Instances

Player

Represents a player in the Players service.

Properties

NameTypeDescription
NamestringPlayer name. Read-only to public ServerScripts and LocalScripts; CoreScripts may change it.
ClassNamestringPlayer.
PlayerIDnumberRead-only numeric Glorpia account identifier. Online Studio playtests use the signed-in account ID. Offline Studio playtests use 0.
PlatformstringRead-only operating-system family reported by the player's client: Windows, macOS, Linux, iOS, Android, or Unknown.
FramesPerSecondnumberRead-only most recently reported client frame rate. It is 0 until the client has produced its first sample.
CharacterModel or nilThe player's current character Model when one exists. It is the same runtime Instance exposed under Workspace.
Name is protected from public scripts so creator code cannot rename runtime Player instances. PlayerID, Platform and FramesPerSecond are also read-only runtime data.

Methods

NameTypeDescription
GetMouse()MouseClient-only. Returns the Mouse object for Players.LocalPlayer. The Mouse exposes X, Y, Button1Down, Button1Up, Button2Down, Button2Up, Move, WheelForward and WheelBackward.
GetNetworkPing()numberReturns the player's most recently measured round-trip network latency in seconds. It is 0 until a ping sample is available.
GetMouse() is available from LocalScripts and CoreScripts and only for Players.LocalPlayer. GetNetworkPing() is readable for Player instances on both client and server.

Events

NameTypeDescription
CharacterAddedsignal (Model)Fires when the Player receives a new Character Model.
CharacterRemovingsignal (Model)Fires when the Player's current Character is removed or replaced.

Camera

NameTypeDescription
CameraMaxZoomDistancenumberMaximum gameplay camera zoom distance. Defaults to 128.
CameraMinZoomDistancenumberMinimum gameplay camera zoom distance. Defaults to 0.5.
NameDisplayDistancenumberMaximum camera distance in studs at which this player's character username tag is rendered. Defaults to 100; 0 hides the tag.
CameraMinZoomDistance and CameraMaxZoomDistance are read by the default CameraScript and can be changed at runtime. NameDisplayDistance is evaluated against the active camera when the username tag is rendered.

Children

Player is a normal hierarchy parent. Scripts and Studio can parent other Instances beneath a Player, and those children replicate with the Player hierarchy. Physical Parts beneath a Player are stored and replicated but are not rendered or simulated until reparented somewhere below Workspace.

Studio playtests

When Studio starts an online playtest, the Player instance uses the signed-in Studio account's username and PlayerID. In Studio offline mode, the playtest identity defaults to Player with PlayerID 0.

The Player and its Character hierarchy remain visible in both Client and Server view. In Server view, Player data is for inspection while the server remains authoritative over the runtime character and replicated world state.

Player runtime example

Luau
local Players = game:GetService("Players")
local player = Players.LocalPlayer

if player then
    local mouse = player:GetMouse()

    mouse.Button1Down:Connect(function()
        print("Mouse:", mouse.X, mouse.Y)
    end)

    player.CharacterAdded:Connect(function(character)
        print("Character added:", character:GetFullName())
    end)

    player.CharacterRemoving:Connect(function(character)
        print("Character removing")
    end)

    print("Ping seconds:", player:GetNetworkPing())
end

Related