Invald table key type used when using remove event fire client

I have the following scenario. I want to send this table from server to client using a remote event:

local tbl = {
e = {
	[4] = true
},
s = {
	{"a"},
	{"b"},
	{"c"},
	{"d"},
}

}

When firing the remove event with this table as argument I get the following error message: Invalid table key type used. I read in Roblox tutorial of remote calls that despite not accepting mixed tables, remote events allows different sub-tables to have different index types. My problem goes away if I replace the 4 by its string equivalent “4”. Does anyone nows why this happens? Using numbers as keys, but not in a sequence as in an array, is allowed in Lua. So how come remote event throws invalid table key type in this scenario?

i believe it’s because if there are skips in a array it cant be sent, so if you were to do

e = {
        [1] = false,
        [2] = false,
        [3] = false,
	    [4] = true
},

it wouldn’t error i believe.

1 Like

Hey @Jaycbee05. You’re right. If I do was you suggested, there is no error. But, for me this don’t makes sense because the lua language allows us to use numbers as keys (arrays are an special case of that as explained here). My problem is that I didn’t find any official documentation for why I cannot send my table through a remote. I wanted to know if this has some purpose of it’s a bug.

2 Likes