Appearance
What's new β
Notable capabilities and recent additions in PlayerState V1. For how data is scoped and replicated, start with Concepts and the data visibility model.
Docs layout: The API reference is split into topic pages under Server, Client, and Typesβbookmark deep links that used #sections may need updating.
Shared session and server-only data β
Shared session β Server-wide non-persistent state for the current server, replicated to every client in that server. Configure via
Server.SharedSessionin PlayerStateConfig. Server APIs includeSetShared,GetShared,SetSharedPath,GetSharedPath,SetSharedValues,OnSharedChanged,GetSharedReplica,GetSharedAll, andIsSharedReady. Client APIs includeGetShared,GetSharedPath,OnSharedChanged,GetSharedReplica,GetSharedAll, andIsSharedReady(reads wait until the shared Replica is ready, similar to profile data). Shared session guide Β· Server API Β· Client APIServer-only player data β
ServerOnlyRoots(for example a top-level"Server"root) persist inprofile.Databut are stripped before the player Replica, so they never replicate to clients.SetOfflineDatacan target those paths where appropriate. Server-only data Β· Data visibility
Session (per-player, non-persistent) and migration β
Session data β Runtime-only roots such as
sessionreplicate during play but do not persist.RuntimeNonPersistentRootsin config lists top-level keys stripped before save.Legacy data migration β Opt-in import from an old DataStore during profile load (strategies include Auto, Overwrite, KeepNew, Manual, and related options).
MigrationResultreports when migration finishes (applied, legacy data, strategy, metadata). Migration guide
Other API highlights β
Server and client references cover the full surface area; these are commonly called out:
- Server
OnChangedβ Replica-backed listeners per player. Change subscription BatchUpdateValuesβ Batch numeric increment/decrement-style updates. BatchUpdateValuesIsPlayerDataReadyβ Non-blocking profile + Replica readiness check. DetailsBatchSetValues/FlushBatchβ Bulk updates with optional flush. Server API- Leaderstats β Automatic integration when configured in DefaultData / config.
ClearPathCache(server) /ClearCache()(client) β Debugging and tuning.- Array & dictionary helpers β
AddToArray,SetInDict, and related operations. GetOfflineData(client) β Saved profile snapshot for another user via RemoteFunction. Client API- Client
OnChangedβ Action-aware change info (Set,TableInsert, etc.), global"."listener,IsReady()for gated reads.
Lifecycle events: BeforeSave, ProfileLoaded, ProfileUnloaded, MigrationResult. Events