Table passed through RemoveEvent is received broken by the Server

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 …

You can try to convert the table into JSON and send over the JSON, and then decode the table:

I’ve tried with JSON but the problem remains the same…

can you give us the table (like an image when you print all the table contents)

My table is similar to the problematic examples shown in the link I sent in my OP…

Why do you need to pass a full table in the first place anyway?

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.

2 Likes

You could split up the array from the dictionary and send 2 tables.

1 Like