SharedTables are used in parallel luau, which I recently learned about.
But I was curious about how and why you would use it. I already found the documentation, but the examples aren’t helping a lot.
According to what I’ve read, it’s used to share state across scripts parented under different Actor instances. Could you give an example of this, please. A brief explanation is also beneficial!
They are what their names suggests: “Shared Tables.” You can transfer information for one actor to another actor using them, when previously you would need hacky workarounds to do so.
You use and access them the same way as a normal table
-- A script under one actor
local t = SharedTable.new()
t.Index = "World"
SharedTableRegistry:SetSharedTable("Test Table", t)
-- A script under another actor
local t = SharedTableRegistry:GetSharedTable("Test Table")
print(t.Index) --> prints "World"