I’m trying to pass a complex table (which mixes arrays and dictionaries) as an argument for FireServer / RemoteEvent.
When it arrives at the server, it has been missing a lot of data.
I found this article that shows that there are several limitations for sending tables via FireServer.
My question is: is this correct? Isn’t it a bug? Because the same article shows that adaptations must be made in this table so that it can be sent correctly as a FireServer argument, therefore, I see no sense in having this limitation intentionally by Roblox Lua …
The best solution is just avoiding such mixed tables (see answer on linked Scripting Helpers question). If you’re using numbers as keys in a dictionary, you might want to use tostring because strings are the only allowed key type in a dictionary sent over RemoteEvents or RemoteFunctions (using numbers as keys will drop all string keys). not 100% sure about the numbers thing, but avoiding the number type entirely is the best option here
If you’re trying to use userdata (most Roblox types) as keys, you need another workaround. One of my games avoids most limitations of remotes with a slightly more complicated binary format to encode strings, numbers, tables, references to Roblox userdata (stored in a table) and some custom data types. My solution is most likely overkill for what you’re trying to do, so you should just use separate tables for dictionaries and arrays.