When sending a table as a remote’s parameter, if any of it’s indices are userdata or another table, then those indicies will be a string when received on the client.
For example,
A table shown below is sent to the client.
{
[game.Workspace.Baseplate] = 1,
[TweenInfo] = "what",
[{1}] = 36,
[function() end] = "yes",
["constant"] = true
}
The client receives the following table instead:
{
["<Instance> (Baseplate)"] = 1,
["<Table> (table: 0x189dd80d06144b32)"] = "what",
["<Table> (table: 0x1ac5eba3cf65d672)"] = 36,
["<Function> (function: 0xcd38e1c7fda40e42)"] = "yes",
["constant"] = true
}
As you can see, the nonstring indicies are converted into strings, never converted back to the actual data type that was given.
This does not happen in tables that have strictly numerical indicies.
Steps to reproduce:
- Open up a new game in studio and publish it.
- Create a Script in ServerScriptService, LocalScript in StarterPlayerScripts, and a RemoteEvent in ReplicatedStorage
- Send the table shown above to the client through that RemoteEvent
- When received on the client, iterate through the table printing the indicies and their data types
Or you can just use the file below:
repro.rbxl (18.5 KB)
This bug happens in studio and in games, I remember not too long ago we were able to send non-string indicies through a remote and it would be received in the proper format. I never saw an announcement about this changing so I’m pretty sure this is a bug that needs to addressed as such a sudden unannounced change could cause a lot of problems with existing games.