ReplicaClient
This item only works when running on the client. ClientReplica
A class for receiving replicated objects from the server.
Functions
getReplicaById
Gets an existing replica
getReplicaAddedSignal
ReplicaClient.
getReplicaAddedSignal
(
class:
string
,
--
Configuration for the replicated object
fireForExisting:
boolean?
--
If true, fire the signal for all existing replicas
) →
Signal.Signal
<
ReplicaClient
>
--
The signal that is fired when a new replica is added
Starts listening for new replicated objects of the specified class
Use fireForExisting
to fire the signal for all existing replicas of the specified class.
GetKeyChangedSignal
ReplicaClient:
GetKeyChangedSignal
(
key:
string
--
The key to get the value of
) →
Signal.Signal
<
ReplicaClient
>
Returns a Signal that fires when a key in the replica is updated
Usage:
local replica = ReplicaClient.getReplicaById("replicaId")
replica:GetKeyChangedSignal("key"):Connect(function(value)
print("Key changed:", value)
end)