Roblox UtilitiesDevlHub Roblox Documentation

Class

NetworkReplicator

NotCreatableNotReplicated
Inherits
Instance › Object
Memory category
Instances
Subclasses
2

An object which handles the replication of other objects either from the server to the client, or from the client to the server.

Each NetworkReplicator corresponds to a single network connection between two peers and serializes, transmits, receives, and applies the stream of data model changes (new instances, property and attribute changes, event invocations, and instance removals) that keeps those peers in sync. It is the base class for the two concrete replicators: a ServerReplicator runs on the server and replicates between the server and the connected client, while a ClientReplicator runs on a client and replicates between that client and the server. A NetworkReplicator is created and managed by the engine automatically as clients connect and disconnect, and is not instantiated or manipulated by creator scripts.

Methods 1#

GetPlayerReturns the player that is connected to the NetworkReplicator.

GetPlayer(): Instance#

Returns the Player associated with the connection that this NetworkReplicator serves. On a ServerReplicator, this is the remote client's player; on a ClientReplicator it is the local player. Returns nil if the replicator has no target player, such as before the connection has been assigned a player or after it has been torn down.

Returns
  • Instance — The Player associated with this NetworkReplicator connection, or nil if the replicator has no target player.

Inherited members#

Inherited from Instance 58
Inherited from Object 6
Properties (2)

ClassName, className

Events (1)

Changed

Subclasses 2#