Skip to content

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.SharedSession in PlayerStateConfig. Server APIs include SetShared, GetShared, SetSharedPath, GetSharedPath, SetSharedValues, OnSharedChanged, GetSharedReplica, GetSharedAll, and IsSharedReady. Client APIs include GetShared, GetSharedPath, OnSharedChanged, GetSharedReplica, GetSharedAll, and IsSharedReady (reads wait until the shared Replica is ready, similar to profile data). Shared session guide Β· Server API Β· Client API

  • Server-only player data β€” ServerOnlyRoots (for example a top-level "Server" root) persist in profile.Data but are stripped before the player Replica, so they never replicate to clients. SetOfflineData can target those paths where appropriate. Server-only data Β· Data visibility

Session (per-player, non-persistent) and migration ​

  • Session data β€” Runtime-only roots such as session replicate during play but do not persist. RuntimeNonPersistentRoots in 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). MigrationResult reports 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. BatchUpdateValues
  • IsPlayerDataReady β€” Non-blocking profile + Replica readiness check. Details
  • BatchSetValues / 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

PlayerState - High-Performance Roblox Data Management