rev_ReplicaSetValue.OnClientEvent:Connect(ReplicaSetValue)rev_ReplicaSetValues.OnClientEvent:Connect(ReplicaSetValues)rev_ReplicaArrayInsert.OnClientEvent:Connect(ReplicaArrayInsert)rev_ReplicaArraySet.OnClientEvent:Connect(ReplicaArraySet)rev_ReplicaArrayRemove.OnClientEvent:Connect(ReplicaArrayRemove)rev_ReplicaWrite.OnClientEvent:Connect(function(d,y,...)local I=Replicas[d]WriteFunctionFlag=true I._write_lib[y](I,...)WriteFunctionFlag=false local t=I._function_listeners[y]if t~=nil then for d,y in ipairs(t)do y(...)end end end)
-- Replica data changes:
rev_ReplicaSetValue.OnClientEvent:Connect(ReplicaSetValue) -- (replica_id, {path}, value)

rev_ReplicaSetValues.OnClientEvent:Connect(ReplicaSetValues) -- (replica_id, {path}, {values})

rev_ReplicaArrayInsert.OnClientEvent:Connect(ReplicaArrayInsert) -- (replica_id, {path}, value)

rev_ReplicaArraySet.OnClientEvent:Connect(ReplicaArraySet) -- (replica_id, {path}, index, value)

rev_ReplicaArrayRemove.OnClientEvent:Connect(ReplicaArrayRemove) -- (replica_id, {path}, index)

rev_ReplicaWrite.OnClientEvent:Connect(function(replica_id, func_id, ...) -- (replica_id, func_id, {params})
	local replica = Replicas[replica_id]
	-- Running function:
	WriteFunctionFlag = true
	replica._write_lib[func_id](replica, ...)
	WriteFunctionFlag = false
	-- Signaling listeners:
	local listeners = replica._function_listeners[func_id]
	if listeners ~= nil then
		for _, listener in ipairs(listeners) do
			listener(...)
		end
	end
end)
