Skip to content

Installation ​

Get the PlayerState model into your place. For first code, use Quick start; for DefaultData and config, see Full setup.

Get the model ​

TIP

The Roblox model includes all dependencies. If you use the default layout, you do not need a manual ProfileStore or Replica install.

Download from the Creator Store (ProfileStore and Replica included):

What's included

Default folder layout ​

PlayerState (Model)
├── PlayerStateServer
├── PlayerStateClient
├── DefaultData
├── PlayerStateConfig
└── Libraries
    ├── ProfileStore
    └── Replica
Module placement options

You can reorganize modules. Update require paths in the server and client modules if you move files.

Common pattern:

ReplicatedStorage
└── Libraries
    └── PlayerState
        ├── PlayerStateServer  → often parented to ServerScriptService
        ├── PlayerStateClient
        └── DefaultData

Other layouts (ServerScriptService + StarterPlayer scripts, etc.) are fine — keep server and client requires consistent with your tree.

Manual installation (advanced) ​

Install dependencies separately

Only needed if you are not using the Roblox model or you moved libraries out of the bundle.

  1. ProfileStore — ProfileStore on Roblox
  2. Replica — Replica on GitHub

Update require paths inside PlayerStateServer and PlayerStateClient if dependencies live elsewhere.

Configuration pointer ​

Datastore name, scope, and other runtime settings live in PlayerStateConfig. See Configuration for the full reference — not duplicated here.

Studio autocomplete ​

Since v2.0.1, Studio autocompletes your DefaultData keys and paths as you type, with no type annotations needed:

This requires the New Type Solver (enable it in Studio's beta features or your place's type-checking settings). Any string still works as before, so paths you build at runtime are fine. PlayerState's own scripts no longer show type errors in Script Analysis under the New Type Solver with --!strict.

Verification ​

Optional: verify require paths

After placing modules, confirm Init runs — same flow as Quick start:

lua
local PlayerState = require(game.ReplicatedStorage.Libraries.PlayerState.PlayerStateServer)

game.Players.PlayerAdded:Connect(function(player)
    if PlayerState.Init(player) then
        print("PlayerState OK for", player.Name)
    end
end)

Next steps ​

PlayerState - High-Performance Roblox Data Management