Owl.Util.Replica.New<T, A, TagT>(params: ReplicaParams<T, A, TagT>): Replica<T, A, TagT>
Server OnlyCreates a new Replica wrapping the given Data table. The Replica is not sent to any client until Replicate() or ReplicateFor() is called.
Parameters
params*ReplicaParams<T, A, TagT> | Token (class name), Data (initial state table), optional Tags (non-replicated metadata), optional Parent (inherits its replication scope) and optional Actions (typed mutation implementations). |
Returns
Replica<T, A, TagT>The constructed Replica instance, not yet replicated to anyone.
Related Types
local PlayerDataActions = require(ReplicatedStorage.PlayerDataActions)
local replica = Owl.Util.Replica.New({
Token = "PlayerData",
Data = { Level = 1, XP = 0, Inventory = {} },
Actions = PlayerDataActions,
})
replica:Replicate()