I am currently getting this error keys must be strings from

for _,plr in pairs(arena.players) do
	local playerTable = client.getPlayerTable(p);
	locations.re.played:FireClient(plr.player, playerTable, tonumber(position), card);
end

Why could this happen? plr.player is the player userdata playerTable is just information about the player position is a number card is another table about a card

client.getPlayerTable(p);

function client.getPlayerTable(p)
	local playerTable = {
			player = p.player;
			health = p.health;
			name = p.name;
			userId = p.userId;
			Board = p.Board;
			Avatar = p.Avatar;
			field = p.field;
	};
	return playerTable;
end

player is just the player object health is a number name is name of the player object userid is the player's userid board is just a string identifying the board same with avatar field is a table of cards in the player's field

Cannot send functions through RemoteEvents :P

4 comments

0

Can you include client.getPlayerTable or give a more full description of playerTable? It's also possible that somehow playerTable includes something you forgot about, so that might be good to look into, too.

0

I have checked all the values inside the playerTable and non of them are nil. That is what confuses me.

0

What are you doing with the arguments when OnClientEvent fires?

1

Oh I see, I figured it out, I was trying to send the metatable of the card as well and you can't send functions through remoteevents.