How would I go about doing these things with ReplicaService? ReplicaService
Adding a table with a index:
local ReplicaService = require(Data:FindFirstChild("ReplicaService")) --made up path to module
--replica example
local Replica = ReplicaService.NewReplica({
ClassToken = ReplicaService.NewClassToken("Replica"),
Data = {Table = {}}
Replication = "All"
})
Replica.Data.Table[OtherTable] = {}
--this can be found with Replica.Data.Table[OtherTable]
--from what I've read the path in this case "Table" for the replicaservice method has to be a string
Replica:ArrayInsert("Table", {}) --adds a table to already existing table (now a nested table)
--following example doesn't work, but defines what I am looking for:
Replica:ArrayInsert({Replica.Data.Table["OtherTableIndex"]}, OtherTable) --trying to add a nested table with it's own index
--Would prefer that nested table to have an index, so it can be called more easily.
--Extra inquiry
Replica:ListenToArrayInsert({"Table"},function(newVal) --then would also be nice if I could listen for the tables inside "Table"
end)