API Reference
Separate server and client entry points, plus types for Luau-style annotations.
No Built-in Client Requests
PlayerState does not ship RemoteEvents or RemoteFunctions. Clients cannot directly change saved data—expose your own remotes and validate everything on the server.
Where to read
| Area | Purpose |
|---|---|
| Server API | Writes, batches, replication, offline tools, leaderboard, Shared Session — all functions |
| Client API | Reads, IsReady, OnChanged, cache, leaderboard display helpers — all functions |
| Server events | BeforeRelease, BeforeSave, ProfileLoaded, ProfileUnloaded, MigrationResult |
| Types | PlayerStateServer, PlayerStateClient, ChangeInfo, config shapes |
Capsule summaries of recent API surface: What's new.
Patterns and ergonomics live in Examples, Best practices, and Guides — Leaderstats & paths—not repeated here.
Module locations
Default layout from the Creator Store model:
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local PlayerStateServer = require(ReplicatedStorage.Libraries.PlayerState.PlayerStateServer)
local PlayerStateClient = require(ReplicatedStorage.Libraries.PlayerState.PlayerStateClient)
local DefaultData = require(ReplicatedStorage.Libraries.PlayerState.DefaultData)
local Config = require(ReplicatedStorage.Libraries.PlayerState.PlayerStateConfig)Adjust paths if you moved modules
Some teams move PlayerStateServer under ServerScriptService and update requires accordingly. See Installation — default folder layout.
Legacy migration & upgrades
Configure opt-in Legacy Data Migration in PlayerStateConfig — Migration.
Older behaviour notes (return values, , automatic leaderstats): see What's new and Migration.IsReady()