Skip to main content

ServerReplicator

This item only works when running on the server. Server

Wraps a TableManager and replicates it to one or more clients. Every write made through .Manager is automatically queued and sent at the end of the current frame.

Players.PlayerAdded:Connect(function(player)
	local replicator = ServerReplicator.new({
		Namespace = "PlayerData",
		Data = { Coins = 0 },
		Targets = player,
		Tags = { UserId = player.UserId },
	})

	replicator.Manager:Set("Coins", 100) -- replicated automatically

	player.Destroying:Connect(function()
		replicator:Destroy()
	end)
end)
Always destroy when done

Call replicator:Destroy() when a replicator is no longer needed. The replicator also listens to its manager's OnDestroy and tears itself down, so destroying the manager is sufficient when the manager's lifetime drives cleanup.

Going further

  • Namespace collision safety — See TOKEN for exclusive namespace ownership in large codebases.
  • Hierarchy — Pass Parent instead of ReplicationTargets to create a child replicator that inherits its ancestor's targets. Use SetParent to reparent later.
  • Custom remotes — Declare signals and functions in config.Client to send events alongside data. See RegisterRemoteSignal, RegisterOrderedRemoteSignal, RegisterRemoteFunction, and RegisterOrderedRemoteFunction.
  • Flush controlCoalesced = true deduplicates redundant same-key ops per frame. ImmediateFlush = true sends this replicator's ops synchronously (before the caller's next line) instead of batching to frame end.
  • SentinelsServerReplicator.All and ServerReplicator.None are pre-built top-level replicators useful as parents.

Properties

ReplicatorCreated

Static
ServerReplicator.ReplicatorCreated: Signal<ServerReplicator>

Signal that fires whenever a new replicator is created, regardless of token.

Id

This item is read only and cannot be modified. Read Only
ServerReplicator.Id: number

The unique Id of this replicator.

Manager

This item is read only and cannot be modified. Read Only
ServerReplicator.Manager: TableManager

The TableManager that this replicator is managing.

Namespace

This item is read only and cannot be modified. Read Only
ServerReplicator.Namespace: string?

The namespace string of this replicator, or nil if anonymous. Matches any string or ReplicationToken SearchCondition when non-nil.

Token

This item is read only and cannot be modified. Read Only
ServerReplicator.Token: ReplicationToken?

The token handle for this replicator, or nil if anonymous or created with a raw-string namespace. Present when the namespace was claimed with ServerReplicator.TOKEN() or when a raw string resolves to the same cached handle. Prefer .Namespace for string comparisons.

Tags

This item is read only and cannot be modified. Read Only
ServerReplicator.Tags: {[string]any}

The tags of this replicator.

ChildAdded

Event
ServerReplicator.ChildAdded: Signal<ServerReplicator>

Fired when a child replicator is added to this replicator.

ChildRemoved

Event
ServerReplicator.ChildRemoved: Signal<ServerReplicator>

Fired when a child replicator is removed from this replicator.

ParentChanged

Event
ServerReplicator.ParentChanged: Signal<ServerReplicator,ServerReplicator>

Fired when this replicator's parent is changed. Passed arguments are (newParent, oldParent).

StrictValueChecks

Static
ServerReplicator.StrictValueChecks: boolean

When true, every value written through a replicator's .Manager is recursively scanned before it is queued, and a warning naming the exact path is emitted if it contains anything a RemoteEvent can't serialize (a function, thread, RBXScriptSignal, or RBXScriptConnection). When false, only the written value's own top-level type is checked (an O(1) test that still catches the common Manager:Set(path, someFunction) mistake). Defaults to RunService:IsStudio() -- deep scanning in Studio, cheap checks in production.

Either way the offending value is dropped in isolation and arrives as nil on clients (see ValueGuard / BufferCodec); these checks only surface where the bad value came from. Read-only -- use SetStrictValueChecks to change it.

TOKEN

Static
ServerReplicator.TOKEN: (namestring) → ReplicationToken

Registers name in the namespace-ownership ledger and returns a ReplicationToken that exclusively owns that name for its lifetime.

Using a token prevents any other system from accidentally creating a replicator with the same namespace string. Call this once per name (usually at the top of a module), store the result, and pass it as the Namespace (or Token) field when creating replicators.

To release the name, call ServerReplicator.TOKEN.destroy(token) after all replicators using it have been destroyed.

You do not need a token for simple cases — a plain string Namespace is fully supported and costs nothing extra:

-- Simple (no collision guard):
ServerReplicator.new({ Namespace = "PlayerData", ... })

-- Opt-in collision safety:
local PlayerToken = ServerReplicator.TOKEN("PlayerData")
ServerReplicator.new({ Namespace = PlayerToken, ... })
One owner per name

TOKEN("name") errors if the name is already owned by another live token or if any raw-string replicators with that name already exist. Claim the token at module load before creating any replicators with that name.

createRemoteEvent

Static
ServerReplicator.createRemoteEvent: () → sentinel

Returns a sentinel value for use in config.Client to declare a reliable custom signal. The sentinel is detected by ServerReplicator.new and replaced with a real ServerCustomRemote.

local r = ServerReplicator.new({
	Namespace = "MyReplicator",
	ReplicationTargets = player,
	Client = {
		Hit = ServerReplicator.createRemoteEvent(),
		GetScore = function(self, player) return 42 end,
	},
})
r.Client.Hit:FireAll()

createUnreliableEvent

Static
ServerReplicator.createUnreliableEvent: () → sentinel

Like createRemoteEvent but uses an UnreliableRemoteEvent so fire-and-forget semantics apply (no ordering or delivery guarantee).

All

Static
ServerReplicator.All: ServerReplicator

A top-level replicator that replicates to every current and future player. Useful as a Parent for children that should always be visible to everyone, but may be moved later. Do not modify it directly — only parent to it.

None

Static
ServerReplicator.None: ServerReplicator

A top-level replicator that replicates to nobody. Useful as a Parent for children that should not replicate yet and are waiting for a proper parent. Do not modify it directly — only parent to it.

Functions

SetListenerFireMode

Static
ServerReplicator.SetListenerFireMode(modeFireMode) → ()

Overrides ListenerFireMode, the scheduling used for ReplicatorCreated, ForEach, and OnNew listeners going forward.

GetFromId

Static
ServerReplicator.GetFromId(idId) → ServerReplicator?

Returns the replicator with the given Id, if one currently exists.

PromiseFromId

Static
ServerReplicator.PromiseFromId(idId) → Promise<ServerReplicator>

Returns a promise that resolves with the replicator with the given Id, if one currently exists or is created in the future.

GetAll

Static
ServerReplicator.GetAll(conditionSearchCondition?) → {ServerReplicator}

Returns every currently-loaded replicator matching condition (no condition = all).

ForEach

Static
ServerReplicator.ForEach(
conditionSearchCondition?,
fn(replicatorServerReplicator) → ()
) → () → ()

Runs fn for every existing replicator matching condition, and again for every future one. Returns a disconnect function that stops future invocations.

local disconnect = ServerReplicator.ForEach("PlayerData", function(replicator)
	print("replicator", replicator.Id, "for", replicator.Tags.UserId)
end)
-- later:
disconnect()

PromiseFirst

Static
ServerReplicator.PromiseFirst(conditionSearchCondition?) → Promise<ServerReplicator>

Resolves with the first existing-or-future replicator matching condition.

GetFirst

Static
ServerReplicator.GetFirst(conditionSearchCondition?) → ServerReplicator?

Returns the first replicator matching condition, or nil if none exists.

OnNew

Static
ServerReplicator.OnNew(
conditionSearchCondition,
fn(replicatorServerReplicator) → ()
) → () → ()

Listens for new replicators matching condition. condition accepts the same forms as GetAll/ForEach: a namespace string, a ReplicationToken, a tags table, or a custom predicate. Returns a disconnect function.

Prefer ForEach

OnNew only fires for replicators created after this call. Use ForEach to also handle any already-existing matches (it runs the callback for those immediately, then subscribes for future ones).

SetStrictValueChecks

Static
ServerReplicator.SetStrictValueChecks(enabledboolean) → ()

Overrides StrictValueChecks, toggling the recursive write-time scan of replicated values going forward.

new

Static
ServerReplicator.new() → ()

Creates a new ServerReplicator.

Exactly one of Parent or ReplicationTargets must be given: a top-level replicator is created with ReplicationTargets (pass {} to start with none), and a child replicator is created with Parent and inherits its top-level ancestor's targets.

Config table fields:

  • Namespace - Optional string or ReplicationToken identifying the replicator's class. Pass a plain string for simple cases, or a token from ServerReplicator.TOKEN() for opt-in collision safety. Omit for anonymous replicators (reachable only by Id, tags, or predicate).
  • Data - A TableManager instance or a raw table to replicate. Defaults to {}.
  • Targets - A Player, list of Players, or "all". Only valid for top-level replicators; pass {} to start with no targets.
  • Parent - A parent ServerReplicator. Only valid for child replicators.
  • Tags - Optional { [string]: any } metadata table used for filtering in ForEach/GetAll/GetFirst.
  • Coalesced - If true, only the latest op per key is sent at frame end, dropping intermediate writes. Defaults to false.
  • ImmediateFlush - If true, this replicator's ops are flushed to the wire synchronously (before the caller's next line) instead of at frame end, so a write lands before any external RemoteEvent fired in the same frame. Only this replicator is flushed; others keep their normal frame batching. Because each write sends immediately, N separate non-batched Sets produce N messages -- wrap bulk writes in manager:Batch(...) to coalesce them into a single immediate send at the end of the batch.
  • Client - Table declaring custom remotes. Values can be ServerReplicator.createRemoteEvent(), ServerReplicator.createUnreliableEvent(), or plain functions (registered as remote functions). See RegisterRemoteSignal.
Namespace collision guard

If you call ServerReplicator.TOKEN("name") to claim a namespace, any attempt to create a replicator with that name as a raw string will throw. Pass the token object directly instead of the string. Conversely, if raw- string replicators already exist for a name, TOKEN() will refuse to claim it until they are all destroyed.

Conflicting Configurations

The following configurations are invalid and will throw an error:

  • Targets and Parent cannot both be specified.
  • Coalesced and ImmediateFlush cannot both be true.

FlushNow

Static
ServerReplicator.FlushNow() → ()

Immediately flushes all pending data ops to active players without waiting for the end-of-frame deferred flush. Use this when you need data changes to arrive before (or alongside) an external RemoteEvent fired in the same frame.

IsTopLevel

ServerReplicator:IsTopLevel() → boolean

Returns true if this replicator has no parent. Only top-level replicators can have their replication targets set directly.

GetParent

ServerReplicator:GetParent() → ServerReplicator?

Gets the parent replicator, or nil if this is a top-level replicator.

GetChildren

ServerReplicator:GetChildren() → {ServerReplicator}

Gets the immediate children of this replicator.

GetDescendants

ServerReplicator:GetDescendants() → {ServerReplicator}

Gets all descendants of this replicator, recursively.

FindFirstChild

ServerReplicator:FindFirstChild(
conditionSearchCondition?,--

optional predicate, token name, or tag set

recursiveboolean?--

whether to search recursively (default false)

) → ServerReplicator?

Finds the first child of this replicator that matches condition, or nil if none.

PromiseFirstChild

ServerReplicator:PromiseFirstChild(conditionSearchCondition?) → Promise<ServerReplicator>

Returns a Promise that resolves with the first child matching condition. Resolves immediately if a matching child already exists; otherwise waits for one to be added.

HasTags

ServerReplicator:HasTags(tagsTags) → boolean

Returns true if every key/value in tags is present on this replicator. IsSupersetOfTags is an alias for this method.

IsSupersetOfTags

ServerReplicator:IsSupersetOfTags(tagsTags) → boolean

Alias for HasTags.

IsSubsetOfTags

ServerReplicator:IsSubsetOfTags(tagsTags) → boolean

Returns true if every key/value on this replicator is present in tags. The inverse of HasTags: this replicator's tags must be a subset of tags.

SetTargets

TopLevel
ServerReplicator:SetTargets(targetsReplicationTargets) → ()

Overwrites this top-level replicator's replication targets.

replicator:SetTargets("all")              -- replicate to everyone
replicator:SetTargets(player)             -- single player
replicator:SetTargets({ player1, player2 }) -- explicit list

AddTarget

TopLevel
ServerReplicator:AddTarget(targetPlayer | {Player}) → ()

Adds a player (or list of players) to this top-level replicator's targets.

RemoveTarget

TopLevel
ServerReplicator:RemoveTarget(targetPlayer | {Player}) → ()

Removes a player (or list of players) from this top-level replicator's targets.

GetTargets

ServerReplicator:GetTargets() → {Player}

Returns a list of players this top-level replicator is currently replicating to.

IsReplicatingTo

ServerReplicator:IsReplicatingTo(playerPlayer) → boolean

Returns whether this replicator is currently replicating to the given player.

SetParent

ServerReplicator:SetParent(newParentServerReplicator) → ()

Re-parents this replicator under newParent, moving its entire subtree. Cannot be called on a top-level replicator; cannot create cycles.

If the move crosses scope boundaries (different top-level ancestors), players only in the old scope receive a Destroy, players only in the new scope receive a fresh snapshot, and players in both receive a SetParent.

RegisterRemoteSignal

ServerReplicator:RegisterRemoteSignal(namestring) → ServerCustomRemote

Registers a reliable custom signal on this replicator. After registration, replicator.Client[name] returns a ServerCustomRemote with Fire, FireAll, FireExcept, FirePredicate, Connect, Once, and Wait.

-- Server
local hitSignal = replicator:RegisterRemoteSignal("Hit")
hitSignal:FireAll("headshot")

-- Client
replicator.Server.Hit:Connect(function(hitType)
	print("Hit:", hitType)
end)

RegisterRemoteUnreliableSignal

ServerReplicator:RegisterRemoteUnreliableSignal(namestring) → ServerCustomRemote

Like RegisterRemoteSignal but uses an UnreliableRemoteEvent for delivery.

RegisterRemoteFunction

ServerReplicator:RegisterRemoteFunction(
namestring,
fn(
playerPlayer,
...any
) → ...any
) → ()

Registers a client→server function. Clients invoke it via replicator.Server[name](...) which yields until the server returns.

RegisterOrderedRemoteSignal

ServerReplicator:RegisterOrderedRemoteSignal(namestring) → ServerCustomRemote

Like RegisterRemoteSignal but delivers fires through the frame buffer, so they arrive at the client in the same ordered sequence as data ops enqueued in the same frame. Clients connect to it the same way: replicator.Server[name]:Connect(...).

RegisterOrderedRemoteFunction

ServerReplicator:RegisterOrderedRemoteFunction(
namestring,
fn(
playerPlayer,
...any
) → ...any
) → ()

Like RegisterRemoteFunction but the server's response is delivered through the frame buffer so it arrives at the client in the same ordered sequence as data ops. The client must call InvokeAsync(...) (returns a Promise) instead of the blocking Invoke(...).

GetRemoteSignal

ServerReplicator:GetRemoteSignal(namestring) → ServerCustomRemote

Returns an already-registered custom signal by name.

Destroy

ServerReplicator:Destroy() → ()

Destroys the replicator and orphans any children to ServerReplicator.None. This is synchronous and immediate; any queued ops for this replicator are dropped, and all active players with the replicator have it destroyed on their end.

Show raw api
{
    "functions": [
        {
            "name": "SetListenerFireMode",
            "desc": "Overrides `ListenerFireMode`, the scheduling used for `ReplicatorCreated`,\n`ForEach`, and `OnNew` listeners going forward.",
            "params": [
                {
                    "name": "mode",
                    "desc": "",
                    "lua_type": "FireMode"
                }
            ],
            "returns": [],
            "function_type": "static",
            "tags": [
                "Static"
            ],
            "source": {
                "line": 166,
                "path": "lib/tablereplicator/src/Shared/BaseReplicator.luau"
            }
        },
        {
            "name": "GetFromId",
            "desc": "Returns the replicator with the given Id, if one currently exists.",
            "params": [
                {
                    "name": "id",
                    "desc": "",
                    "lua_type": "Id"
                }
            ],
            "returns": [
                {
                    "desc": "",
                    "lua_type": "ServerReplicator?"
                }
            ],
            "function_type": "static",
            "tags": [
                "Static"
            ],
            "source": {
                "line": 215,
                "path": "lib/tablereplicator/src/Shared/BaseReplicator.luau"
            }
        },
        {
            "name": "PromiseFromId",
            "desc": "Returns a promise that resolves with the replicator with the given Id, if one currently exists or is created in the future.",
            "params": [
                {
                    "name": "id",
                    "desc": "",
                    "lua_type": "Id"
                }
            ],
            "returns": [
                {
                    "desc": "",
                    "lua_type": "Promise<ServerReplicator>"
                }
            ],
            "function_type": "static",
            "tags": [
                "Static"
            ],
            "source": {
                "line": 235,
                "path": "lib/tablereplicator/src/Shared/BaseReplicator.luau"
            }
        },
        {
            "name": "GetAll",
            "desc": "Returns every currently-loaded replicator matching `condition` (no condition = all).",
            "params": [
                {
                    "name": "condition",
                    "desc": "",
                    "lua_type": "SearchCondition?"
                }
            ],
            "returns": [
                {
                    "desc": "",
                    "lua_type": "{ ServerReplicator }"
                }
            ],
            "function_type": "static",
            "tags": [
                "Static"
            ],
            "source": {
                "line": 263,
                "path": "lib/tablereplicator/src/Shared/BaseReplicator.luau"
            }
        },
        {
            "name": "ForEach",
            "desc": "Runs `fn` for every existing replicator matching `condition`, and again for\nevery future one. Returns a disconnect function that stops future invocations.\n\n```lua\nlocal disconnect = ServerReplicator.ForEach(\"PlayerData\", function(replicator)\n\tprint(\"replicator\", replicator.Id, \"for\", replicator.Tags.UserId)\nend)\n-- later:\ndisconnect()\n```",
            "params": [
                {
                    "name": "condition",
                    "desc": "",
                    "lua_type": "SearchCondition?"
                },
                {
                    "name": "fn",
                    "desc": "",
                    "lua_type": "(replicator: ServerReplicator) -> ()"
                }
            ],
            "returns": [
                {
                    "desc": "",
                    "lua_type": "() -> ()"
                }
            ],
            "function_type": "static",
            "tags": [
                "Static"
            ],
            "source": {
                "line": 302,
                "path": "lib/tablereplicator/src/Shared/BaseReplicator.luau"
            }
        },
        {
            "name": "PromiseFirst",
            "desc": "Resolves with the first existing-or-future replicator matching `condition`.",
            "params": [
                {
                    "name": "condition",
                    "desc": "",
                    "lua_type": "SearchCondition?"
                }
            ],
            "returns": [
                {
                    "desc": "",
                    "lua_type": "Promise<ServerReplicator>"
                }
            ],
            "function_type": "static",
            "tags": [
                "Static"
            ],
            "source": {
                "line": 356,
                "path": "lib/tablereplicator/src/Shared/BaseReplicator.luau"
            }
        },
        {
            "name": "GetFirst",
            "desc": "Returns the first replicator matching `condition`, or nil if none exists.",
            "params": [
                {
                    "name": "condition",
                    "desc": "",
                    "lua_type": "SearchCondition?"
                }
            ],
            "returns": [
                {
                    "desc": "",
                    "lua_type": "ServerReplicator?"
                }
            ],
            "function_type": "static",
            "tags": [
                "Static"
            ],
            "source": {
                "line": 388,
                "path": "lib/tablereplicator/src/Shared/BaseReplicator.luau"
            }
        },
        {
            "name": "OnNew",
            "desc": "Listens for *new* replicators matching `condition`. `condition` accepts the\nsame forms as `GetAll`/`ForEach`: a namespace string, a `ReplicationToken`,\na tags table, or a custom predicate. Returns a disconnect function.\n\n:::caution Prefer ForEach\n`OnNew` only fires for replicators created **after** this call. Use `ForEach`\nto also handle any already-existing matches (it runs the callback for those\nimmediately, then subscribes for future ones).\n:::",
            "params": [
                {
                    "name": "condition",
                    "desc": "",
                    "lua_type": "SearchCondition"
                },
                {
                    "name": "fn",
                    "desc": "",
                    "lua_type": "(replicator: ServerReplicator) -> ()"
                }
            ],
            "returns": [
                {
                    "desc": "",
                    "lua_type": "() -> ()"
                }
            ],
            "function_type": "static",
            "tags": [
                "Static"
            ],
            "source": {
                "line": 423,
                "path": "lib/tablereplicator/src/Shared/BaseReplicator.luau"
            }
        },
        {
            "name": "IsTopLevel",
            "desc": "Returns true if this replicator has no parent. Only top-level replicators\ncan have their replication targets set directly.",
            "params": [],
            "returns": [
                {
                    "desc": "",
                    "lua_type": "boolean"
                }
            ],
            "function_type": "method",
            "source": {
                "line": 603,
                "path": "lib/tablereplicator/src/Shared/BaseReplicator.luau"
            }
        },
        {
            "name": "GetParent",
            "desc": "Gets the parent replicator, or nil if this is a top-level replicator.",
            "params": [],
            "returns": [
                {
                    "desc": "",
                    "lua_type": "ServerReplicator?"
                }
            ],
            "function_type": "method",
            "source": {
                "line": 623,
                "path": "lib/tablereplicator/src/Shared/BaseReplicator.luau"
            }
        },
        {
            "name": "GetChildren",
            "desc": "Gets the immediate children of this replicator.",
            "params": [],
            "returns": [
                {
                    "desc": "",
                    "lua_type": "{ ServerReplicator }"
                }
            ],
            "function_type": "method",
            "source": {
                "line": 639,
                "path": "lib/tablereplicator/src/Shared/BaseReplicator.luau"
            }
        },
        {
            "name": "GetDescendants",
            "desc": "Gets all descendants of this replicator, recursively.",
            "params": [],
            "returns": [
                {
                    "desc": "",
                    "lua_type": "{ ServerReplicator }"
                }
            ],
            "function_type": "method",
            "source": {
                "line": 655,
                "path": "lib/tablereplicator/src/Shared/BaseReplicator.luau"
            }
        },
        {
            "name": "FindFirstChild",
            "desc": "Finds the first child of this replicator that matches `condition`, or nil if none.",
            "params": [
                {
                    "name": "condition",
                    "desc": "optional predicate, token name, or tag set",
                    "lua_type": "SearchCondition?"
                },
                {
                    "name": "recursive",
                    "desc": "whether to search recursively (default false)",
                    "lua_type": "boolean?"
                }
            ],
            "returns": [
                {
                    "desc": "",
                    "lua_type": "ServerReplicator?"
                }
            ],
            "function_type": "method",
            "source": {
                "line": 681,
                "path": "lib/tablereplicator/src/Shared/BaseReplicator.luau"
            }
        },
        {
            "name": "PromiseFirstChild",
            "desc": "Returns a Promise that resolves with the first child matching `condition`.\nResolves immediately if a matching child already exists; otherwise waits for\none to be added.",
            "params": [
                {
                    "name": "condition",
                    "desc": "",
                    "lua_type": "SearchCondition?"
                }
            ],
            "returns": [
                {
                    "desc": "",
                    "lua_type": "Promise<ServerReplicator>"
                }
            ],
            "function_type": "method",
            "source": {
                "line": 723,
                "path": "lib/tablereplicator/src/Shared/BaseReplicator.luau"
            }
        },
        {
            "name": "HasTags",
            "desc": "Returns true if every key/value in `tags` is present on this replicator.\n`IsSupersetOfTags` is an alias for this method.",
            "params": [
                {
                    "name": "tags",
                    "desc": "",
                    "lua_type": "Tags"
                }
            ],
            "returns": [
                {
                    "desc": "",
                    "lua_type": "boolean"
                }
            ],
            "function_type": "method",
            "source": {
                "line": 757,
                "path": "lib/tablereplicator/src/Shared/BaseReplicator.luau"
            }
        },
        {
            "name": "IsSupersetOfTags",
            "desc": "Alias for `HasTags`.",
            "params": [
                {
                    "name": "tags",
                    "desc": "",
                    "lua_type": "Tags"
                }
            ],
            "returns": [
                {
                    "desc": "",
                    "lua_type": "boolean"
                }
            ],
            "function_type": "method",
            "source": {
                "line": 781,
                "path": "lib/tablereplicator/src/Shared/BaseReplicator.luau"
            }
        },
        {
            "name": "IsSubsetOfTags",
            "desc": "Returns true if every key/value on this replicator is present in `tags`.\nThe inverse of `HasTags`: this replicator's tags must be a subset of `tags`.",
            "params": [
                {
                    "name": "tags",
                    "desc": "",
                    "lua_type": "Tags"
                }
            ],
            "returns": [
                {
                    "desc": "",
                    "lua_type": "boolean"
                }
            ],
            "function_type": "method",
            "source": {
                "line": 798,
                "path": "lib/tablereplicator/src/Shared/BaseReplicator.luau"
            }
        },
        {
            "name": "SetStrictValueChecks",
            "desc": "Overrides `StrictValueChecks`, toggling the recursive write-time scan of\nreplicated values going forward.",
            "params": [
                {
                    "name": "enabled",
                    "desc": "",
                    "lua_type": "boolean"
                }
            ],
            "returns": [],
            "function_type": "static",
            "tags": [
                "Static"
            ],
            "source": {
                "line": 115,
                "path": "lib/tablereplicator/src/Server/ServerReplicator.luau"
            }
        },
        {
            "name": "new",
            "desc": "Creates a new `ServerReplicator`.\n\nExactly one of `Parent` or `ReplicationTargets` must be given: a top-level\nreplicator is created with `ReplicationTargets` (pass `{}` to start with\nnone), and a child replicator is created with `Parent` and inherits its\ntop-level ancestor's targets.\n\nConfig table fields:\n- `Namespace` - Optional string or `ReplicationToken` identifying the\n  replicator's class. Pass a plain string for simple cases, or a token\n  from `ServerReplicator.TOKEN()` for opt-in collision safety. Omit for\n  anonymous replicators (reachable only by Id, tags, or predicate).\n- `Data` - A `TableManager` instance or a raw table to replicate. Defaults to `{}`.\n- `Targets` - A `Player`, list of `Player`s, or `\"all\"`. Only valid\n  for top-level replicators; pass `{}` to start with no targets.\n- `Parent` - A parent `ServerReplicator`. Only valid for child replicators.\n- `Tags` - Optional `{ [string]: any }` metadata table used for filtering in\n  `ForEach`/`GetAll`/`GetFirst`.\n- `Coalesced` - If true, only the latest op per key is sent at frame end,\n  dropping intermediate writes. Defaults to false.\n- `ImmediateFlush` - If true, this replicator's ops are flushed to the wire\n  synchronously (before the caller's next line) instead of at frame end, so a\n  write lands before any external `RemoteEvent` fired in the same frame. Only\n  this replicator is flushed; others keep their normal frame batching. Because\n  each write sends immediately, N separate non-batched `Set`s produce N\n  messages -- wrap bulk writes in `manager:Batch(...)` to coalesce them into a\n  single immediate send at the end of the batch.\n- `Client` - Table declaring custom remotes. Values can be\n  `ServerReplicator.createRemoteEvent()`, `ServerReplicator.createUnreliableEvent()`,\n  or plain functions (registered as remote functions). See `RegisterRemoteSignal`.\n\n:::caution Namespace collision guard\nIf you call `ServerReplicator.TOKEN(\"name\")` to claim a namespace, any\nattempt to create a replicator with that name as a raw string will throw.\nPass the token object directly instead of the string. Conversely, if raw-\nstring replicators already exist for a name, `TOKEN()` will refuse to claim\nit until they are all destroyed.\n:::\n\n:::caution Conflicting Configurations\nThe following configurations are invalid and will throw an error:\n- `Targets` and `Parent` cannot both be specified.\n- `Coalesced` and `ImmediateFlush` cannot both be true.\n:::",
            "params": [],
            "returns": [],
            "function_type": "static",
            "tags": [
                "Static"
            ],
            "source": {
                "line": 412,
                "path": "lib/tablereplicator/src/Server/ServerReplicator.luau"
            }
        },
        {
            "name": "_FlushIfImmediate",
            "desc": "Flushes this replicator's queued ops to the wire now if it's an ImmediateFlush\nreplicator and no manager batch window is currently open. Called from the\nsignal paths (custom-remote fires, ordered-fn responses) after `QueueSignal`,\nmirroring the data path's synchronous flush. The batch guard keeps a signal\nfired inside a `manager:Batch(...)` buffered until the whole window ships at\nBatchEnd (see the OnApplied handler), so an ordered signal never jumps ahead\nof data queued before it.",
            "params": [
                {
                    "name": "self",
                    "desc": "",
                    "lua_type": "SR_Internal"
                }
            ],
            "returns": [],
            "function_type": "static",
            "ignore": true,
            "source": {
                "line": 568,
                "path": "lib/tablereplicator/src/Server/ServerReplicator.luau"
            }
        },
        {
            "name": "_SendSnapshotTo",
            "desc": "Sends `replicator`'s subtree to `player` and marks them active in `replicator`'s scope.",
            "params": [
                {
                    "name": "self",
                    "desc": "",
                    "lua_type": "SR_Internal"
                },
                {
                    "name": "player",
                    "desc": "",
                    "lua_type": "Player"
                }
            ],
            "returns": [],
            "function_type": "static",
            "ignore": true,
            "source": {
                "line": 582,
                "path": "lib/tablereplicator/src/Server/ServerReplicator.luau"
            }
        },
        {
            "name": "_AddTarget",
            "desc": "Adds `player` to this replicator's scope, sending a snapshot if they have\nalready bootstrapped. Does nothing if the player is already targeted.",
            "params": [
                {
                    "name": "self",
                    "desc": "",
                    "lua_type": "SR_Internal"
                },
                {
                    "name": "player",
                    "desc": "",
                    "lua_type": "Player"
                }
            ],
            "returns": [],
            "function_type": "static",
            "ignore": true,
            "source": {
                "line": 594,
                "path": "lib/tablereplicator/src/Server/ServerReplicator.luau"
            }
        },
        {
            "name": "_RemoveTarget",
            "desc": "Removes `player` from this replicator's scope, sending a `Destroy` if they\nwere active. Does nothing if the player is not targeted.",
            "params": [
                {
                    "name": "self",
                    "desc": "",
                    "lua_type": "SR_Internal"
                },
                {
                    "name": "player",
                    "desc": "",
                    "lua_type": "Player"
                }
            ],
            "returns": [],
            "function_type": "static",
            "ignore": true,
            "source": {
                "line": 612,
                "path": "lib/tablereplicator/src/Server/ServerReplicator.luau"
            }
        },
        {
            "name": "SetTargets",
            "desc": "Overwrites this top-level replicator's replication targets.\n\n```lua\nreplicator:SetTargets(\"all\")              -- replicate to everyone\nreplicator:SetTargets(player)             -- single player\nreplicator:SetTargets({ player1, player2 }) -- explicit list\n```",
            "params": [
                {
                    "name": "targets",
                    "desc": "",
                    "lua_type": "ReplicationTargets"
                }
            ],
            "returns": [],
            "function_type": "method",
            "tags": [
                "TopLevel"
            ],
            "source": {
                "line": 637,
                "path": "lib/tablereplicator/src/Server/ServerReplicator.luau"
            }
        },
        {
            "name": "AddTarget",
            "desc": "Adds a player (or list of players) to this top-level replicator's targets.",
            "params": [
                {
                    "name": "target",
                    "desc": "",
                    "lua_type": "Player | { Player }"
                }
            ],
            "returns": [],
            "function_type": "method",
            "tags": [
                "TopLevel"
            ],
            "source": {
                "line": 682,
                "path": "lib/tablereplicator/src/Server/ServerReplicator.luau"
            }
        },
        {
            "name": "RemoveTarget",
            "desc": "Removes a player (or list of players) from this top-level replicator's targets.",
            "params": [
                {
                    "name": "target",
                    "desc": "",
                    "lua_type": "Player | { Player }"
                }
            ],
            "returns": [],
            "function_type": "method",
            "tags": [
                "TopLevel"
            ],
            "source": {
                "line": 701,
                "path": "lib/tablereplicator/src/Server/ServerReplicator.luau"
            }
        },
        {
            "name": "GetTargets",
            "desc": "Returns a list of players this top-level replicator is currently replicating to.",
            "params": [],
            "returns": [
                {
                    "desc": "",
                    "lua_type": "{ Player }"
                }
            ],
            "function_type": "method",
            "source": {
                "line": 716,
                "path": "lib/tablereplicator/src/Server/ServerReplicator.luau"
            }
        },
        {
            "name": "IsReplicatingTo",
            "desc": "Returns whether this replicator is currently replicating to the given player.",
            "params": [
                {
                    "name": "player",
                    "desc": "",
                    "lua_type": "Player"
                }
            ],
            "returns": [
                {
                    "desc": "",
                    "lua_type": "boolean"
                }
            ],
            "function_type": "method",
            "source": {
                "line": 728,
                "path": "lib/tablereplicator/src/Server/ServerReplicator.luau"
            }
        },
        {
            "name": "SetParent",
            "desc": "Re-parents this replicator under `newParent`, moving its entire subtree.\nCannot be called on a top-level replicator; cannot create cycles.\n\nIf the move crosses scope boundaries (different top-level ancestors), players\nonly in the old scope receive a `Destroy`, players only in the new scope\nreceive a fresh snapshot, and players in both receive a `SetParent`.",
            "params": [
                {
                    "name": "newParent",
                    "desc": "",
                    "lua_type": "ServerReplicator"
                }
            ],
            "returns": [],
            "function_type": "method",
            "source": {
                "line": 748,
                "path": "lib/tablereplicator/src/Server/ServerReplicator.luau"
            }
        },
        {
            "name": "RegisterRemoteSignal",
            "desc": "Registers a reliable custom signal on this replicator. After registration,\n`replicator.Client[name]` returns a `ServerCustomRemote` with `Fire`,\n`FireAll`, `FireExcept`, `FirePredicate`, `Connect`, `Once`, and `Wait`.\n\n```lua\n-- Server\nlocal hitSignal = replicator:RegisterRemoteSignal(\"Hit\")\nhitSignal:FireAll(\"headshot\")\n\n-- Client\nreplicator.Server.Hit:Connect(function(hitType)\n\tprint(\"Hit:\", hitType)\nend)\n```",
            "params": [
                {
                    "name": "name",
                    "desc": "",
                    "lua_type": "string"
                }
            ],
            "returns": [
                {
                    "desc": "",
                    "lua_type": "ServerCustomRemote"
                }
            ],
            "function_type": "method",
            "source": {
                "line": 838,
                "path": "lib/tablereplicator/src/Server/ServerReplicator.luau"
            }
        },
        {
            "name": "RegisterRemoteUnreliableSignal",
            "desc": "Like `RegisterRemoteSignal` but uses an `UnreliableRemoteEvent` for delivery.",
            "params": [
                {
                    "name": "name",
                    "desc": "",
                    "lua_type": "string"
                }
            ],
            "returns": [
                {
                    "desc": "",
                    "lua_type": "ServerCustomRemote"
                }
            ],
            "function_type": "method",
            "source": {
                "line": 857,
                "path": "lib/tablereplicator/src/Server/ServerReplicator.luau"
            }
        },
        {
            "name": "RegisterRemoteFunction",
            "desc": "Registers a client→server function. Clients invoke it via\n`replicator.Server[name](...)` which yields until the server returns.",
            "params": [
                {
                    "name": "name",
                    "desc": "",
                    "lua_type": "string"
                },
                {
                    "name": "fn",
                    "desc": "",
                    "lua_type": "(self: ServerReplicator, player: Player, ...any) -> ...any"
                }
            ],
            "returns": [],
            "function_type": "method",
            "source": {
                "line": 877,
                "path": "lib/tablereplicator/src/Server/ServerReplicator.luau"
            }
        },
        {
            "name": "RegisterOrderedRemoteSignal",
            "desc": "Like `RegisterRemoteSignal` but delivers fires through the frame buffer,\nso they arrive at the client in the same ordered sequence as data ops\nenqueued in the same frame. Clients connect to it the same way:\n`replicator.Server[name]:Connect(...)`.",
            "params": [
                {
                    "name": "name",
                    "desc": "",
                    "lua_type": "string"
                }
            ],
            "returns": [
                {
                    "desc": "",
                    "lua_type": "ServerCustomRemote"
                }
            ],
            "function_type": "method",
            "source": {
                "line": 897,
                "path": "lib/tablereplicator/src/Server/ServerReplicator.luau"
            }
        },
        {
            "name": "RegisterOrderedRemoteFunction",
            "desc": "Like `RegisterRemoteFunction` but the server's response is delivered\nthrough the frame buffer so it arrives at the client in the same ordered\nsequence as data ops. The client must call `InvokeAsync(...)` (returns a\nPromise) instead of the blocking `Invoke(...)`.",
            "params": [
                {
                    "name": "name",
                    "desc": "",
                    "lua_type": "string"
                },
                {
                    "name": "fn",
                    "desc": "",
                    "lua_type": "(self: ServerReplicator, player: Player, ...any) -> ...any"
                }
            ],
            "returns": [],
            "function_type": "method",
            "source": {
                "line": 919,
                "path": "lib/tablereplicator/src/Server/ServerReplicator.luau"
            }
        },
        {
            "name": "GetRemoteSignal",
            "desc": "Returns an already-registered custom signal by name.",
            "params": [
                {
                    "name": "name",
                    "desc": "",
                    "lua_type": "string"
                }
            ],
            "returns": [
                {
                    "desc": "",
                    "lua_type": "ServerCustomRemote"
                }
            ],
            "function_type": "method",
            "source": {
                "line": 936,
                "path": "lib/tablereplicator/src/Server/ServerReplicator.luau"
            }
        },
        {
            "name": "Destroy",
            "desc": "Destroys the replicator and orphans any children to `ServerReplicator.None`.\nThis is synchronous and immediate; any queued ops for this replicator are \ndropped, and all active players with the replicator have it destroyed on their end.",
            "params": [],
            "returns": [],
            "function_type": "method",
            "source": {
                "line": 953,
                "path": "lib/tablereplicator/src/Server/ServerReplicator.luau"
            }
        },
        {
            "name": "FlushNow",
            "desc": "Immediately flushes all pending data ops to active players without waiting\nfor the end-of-frame deferred flush. Use this when you need data changes to\narrive before (or alongside) an external `RemoteEvent` fired in the same frame.",
            "params": [],
            "returns": [],
            "function_type": "static",
            "tags": [
                "Static"
            ],
            "source": {
                "line": 1082,
                "path": "lib/tablereplicator/src/Server/ServerReplicator.luau"
            }
        }
    ],
    "properties": [
        {
            "name": "ReplicatorCreated",
            "desc": "Signal that fires whenever a new replicator is created, regardless of token.",
            "lua_type": "Signal<ServerReplicator>",
            "tags": [
                "Static"
            ],
            "source": {
                "line": 142,
                "path": "lib/tablereplicator/src/Shared/BaseReplicator.luau"
            }
        },
        {
            "name": "Id",
            "desc": "The unique Id of this replicator.",
            "lua_type": "number",
            "readonly": true,
            "source": {
                "line": 222,
                "path": "lib/tablereplicator/src/Shared/Types.luau"
            }
        },
        {
            "name": "Manager",
            "desc": "The TableManager that this replicator is managing.",
            "lua_type": "TableManager",
            "readonly": true,
            "source": {
                "line": 232,
                "path": "lib/tablereplicator/src/Shared/Types.luau"
            }
        },
        {
            "name": "Namespace",
            "desc": "The namespace string of this replicator, or `nil` if anonymous.\nMatches any `string` or `ReplicationToken` `SearchCondition` when non-nil.",
            "lua_type": "string?",
            "readonly": true,
            "source": {
                "line": 243,
                "path": "lib/tablereplicator/src/Shared/Types.luau"
            }
        },
        {
            "name": "Token",
            "desc": "The token handle for this replicator, or `nil` if anonymous or created with\na raw-string namespace. Present when the namespace was claimed with\n`ServerReplicator.TOKEN()` or when a raw string resolves to the same cached\nhandle. Prefer `.Namespace` for string comparisons.",
            "lua_type": "ReplicationToken?",
            "readonly": true,
            "source": {
                "line": 256,
                "path": "lib/tablereplicator/src/Shared/Types.luau"
            }
        },
        {
            "name": "Tags",
            "desc": "The tags of this replicator.",
            "lua_type": "{ [string]: any }",
            "readonly": true,
            "source": {
                "line": 266,
                "path": "lib/tablereplicator/src/Shared/Types.luau"
            }
        },
        {
            "name": "ChildAdded",
            "desc": "Fired when a child replicator is added to this replicator.",
            "lua_type": "Signal<ServerReplicator>",
            "tags": [
                "Event"
            ],
            "source": {
                "line": 277,
                "path": "lib/tablereplicator/src/Shared/Types.luau"
            }
        },
        {
            "name": "ChildRemoved",
            "desc": "Fired when a child replicator is removed from this replicator.",
            "lua_type": "Signal<ServerReplicator>",
            "tags": [
                "Event"
            ],
            "source": {
                "line": 287,
                "path": "lib/tablereplicator/src/Shared/Types.luau"
            }
        },
        {
            "name": "ParentChanged",
            "desc": "Fired when this replicator's parent is changed.\nPassed arguments are `(newParent, oldParent)`.",
            "lua_type": "Signal<ServerReplicator, ServerReplicator>",
            "tags": [
                "Event"
            ],
            "source": {
                "line": 298,
                "path": "lib/tablereplicator/src/Shared/Types.luau"
            }
        },
        {
            "name": "StrictValueChecks",
            "desc": "When `true`, every value written through a replicator's `.Manager` is\nrecursively scanned before it is queued, and a warning naming the exact path\nis emitted if it contains anything a `RemoteEvent` can't serialize (a function,\nthread, `RBXScriptSignal`, or `RBXScriptConnection`). When `false`, only the\nwritten value's own top-level type is checked (an O(1) test that still catches\nthe common `Manager:Set(path, someFunction)` mistake). Defaults to\n`RunService:IsStudio()` -- deep scanning in Studio, cheap checks in production.\n\nEither way the offending value is dropped in isolation and arrives as nil on\nclients (see `ValueGuard` / `BufferCodec`); these checks only surface *where*\nthe bad value came from. Read-only -- use `SetStrictValueChecks` to change it.",
            "lua_type": "boolean",
            "tags": [
                "Static"
            ],
            "source": {
                "line": 105,
                "path": "lib/tablereplicator/src/Server/ServerReplicator.luau"
            }
        },
        {
            "name": "TOKEN",
            "desc": "Registers `name` in the namespace-ownership ledger and returns a\n`ReplicationToken` that exclusively owns that name for its lifetime.\n\nUsing a token prevents any other system from accidentally creating a\nreplicator with the same namespace string. Call this once per name\n(usually at the top of a module), store the result, and pass it as the\n`Namespace` (or `Token`) field when creating replicators.\n\nTo release the name, call `ServerReplicator.TOKEN.destroy(token)` after all\nreplicators using it have been destroyed.\n\n**You do not need a token** for simple cases — a plain string `Namespace`\nis fully supported and costs nothing extra:\n```lua\n-- Simple (no collision guard):\nServerReplicator.new({ Namespace = \"PlayerData\", ... })\n\n-- Opt-in collision safety:\nlocal PlayerToken = ServerReplicator.TOKEN(\"PlayerData\")\nServerReplicator.new({ Namespace = PlayerToken, ... })\n```\n\n:::caution One owner per name\n`TOKEN(\"name\")` errors if the name is already owned by another live token\n**or** if any raw-string replicators with that name already exist. Claim the\ntoken at module load before creating any replicators with that name.\n:::",
            "lua_type": "(name: string) -> ReplicationToken",
            "tags": [
                "Static"
            ],
            "source": {
                "line": 303,
                "path": "lib/tablereplicator/src/Server/ServerReplicator.luau"
            }
        },
        {
            "name": "createRemoteEvent",
            "desc": "Returns a sentinel value for use in `config.Client` to declare a reliable\ncustom signal. The sentinel is detected by `ServerReplicator.new` and\nreplaced with a real `ServerCustomRemote`.\n\n```lua\nlocal r = ServerReplicator.new({\n\tNamespace = \"MyReplicator\",\n\tReplicationTargets = player,\n\tClient = {\n\t\tHit = ServerReplicator.createRemoteEvent(),\n\t\tGetScore = function(self, player) return 42 end,\n\t},\n})\nr.Client.Hit:FireAll()\n```",
            "lua_type": "() -> sentinel",
            "tags": [
                "Static"
            ],
            "source": {
                "line": 343,
                "path": "lib/tablereplicator/src/Server/ServerReplicator.luau"
            }
        },
        {
            "name": "createUnreliableEvent",
            "desc": "Like `createRemoteEvent` but uses an `UnreliableRemoteEvent` so fire-and-forget\nsemantics apply (no ordering or delivery guarantee).",
            "lua_type": "() -> sentinel",
            "tags": [
                "Static"
            ],
            "source": {
                "line": 354,
                "path": "lib/tablereplicator/src/Server/ServerReplicator.luau"
            }
        },
        {
            "name": "All",
            "desc": "A top-level replicator that replicates to every current and future\nplayer. Useful as a `Parent` for children that should always be visible\nto everyone, but may be moved later. Do not modify it directly — only parent to it.",
            "lua_type": "ServerReplicator",
            "tags": [
                "Static"
            ],
            "source": {
                "line": 1100,
                "path": "lib/tablereplicator/src/Server/ServerReplicator.luau"
            }
        },
        {
            "name": "None",
            "desc": "A top-level replicator that replicates to nobody. Useful as a `Parent`\nfor children that should not replicate yet and are waiting for a proper\nparent. Do not modify it directly — only parent to it.",
            "lua_type": "ServerReplicator",
            "tags": [
                "Static"
            ],
            "source": {
                "line": 1113,
                "path": "lib/tablereplicator/src/Server/ServerReplicator.luau"
            }
        }
    ],
    "types": [],
    "name": "ServerReplicator",
    "desc": "Wraps a `TableManager` and replicates it to one or more clients. Every write\nmade through `.Manager` is automatically queued and sent at the end of the\ncurrent frame.\n\n```lua\nPlayers.PlayerAdded:Connect(function(player)\n\tlocal replicator = ServerReplicator.new({\n\t\tNamespace = \"PlayerData\",\n\t\tData = { Coins = 0 },\n\t\tTargets = player,\n\t\tTags = { UserId = player.UserId },\n\t})\n\n\treplicator.Manager:Set(\"Coins\", 100) -- replicated automatically\n\n\tplayer.Destroying:Connect(function()\n\t\treplicator:Destroy()\n\tend)\nend)\n```\n\n:::caution Always destroy when done\nCall `replicator:Destroy()` when a replicator is no longer needed. The replicator\nalso listens to its manager's `OnDestroy` and tears itself down, so destroying\nthe manager is sufficient when the manager's lifetime drives cleanup.\n:::\n\n### Going further\n- **Namespace collision safety** — See `TOKEN` for exclusive namespace ownership\n  in large codebases.\n- **Hierarchy** — Pass `Parent` instead of `ReplicationTargets` to create a child\n  replicator that inherits its ancestor's targets. Use `SetParent` to reparent later.\n- **Custom remotes** — Declare signals and functions in `config.Client` to send\n  events alongside data. See `RegisterRemoteSignal`, `RegisterOrderedRemoteSignal`,\n  `RegisterRemoteFunction`, and `RegisterOrderedRemoteFunction`.\n- **Flush control** — `Coalesced = true` deduplicates redundant same-key ops per\n  frame. `ImmediateFlush = true` sends this replicator's ops synchronously\n  (before the caller's next line) instead of batching to frame end.\n- **Sentinels** — `ServerReplicator.All` and `ServerReplicator.None` are\n  pre-built top-level replicators useful as parents.",
    "realm": [
        "Server"
    ],
    "source": {
        "line": 49,
        "path": "lib/tablereplicator/src/Server/ServerReplicator.luau"
    }
}