local ReplicatedStorage = game:GetService("ReplicatedStorage") local Packages = ReplicatedStorage.Packages local Shared = ReplicatedStorage.Shared local Knit = require(Packages.Knit) local TableUtil = require(Packages.TableUtil) local DeltaTable = require(Shared.DeltaTable) local ReplicationService local PlayerService local ReplicationController = Knit.CreateController({ Name = script.Name, Tables = {}, }) function ReplicationController:KnitStart() end function ReplicationController:KnitInit() ReplicationService = Knit.GetService("ReplicationService") PlayerService = Knit.GetService("PlayerService") ReplicationService.Replicate:Connect(function(record) if self.Tables[record.name] == nil then self.Tables[record.name] = TableUtil.Copy(record.data, true) else self.Tables[record.name] = DeltaTable:MergeTable(self.Tables[record.name], record.data) end end) PlayerService.ClientConnected:Fire() end return ReplicationController