Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

[Solved] Keys cannot be strings in Remote Events? [closed]

Asked by 9 years ago

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

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. BlueTaslem 18071 — 9y
0
I have checked all the values inside the playerTable and non of them are nil. That is what confuses me. PiggyJingles 358 — 9y
0
What are you doing with the arguments when OnClientEvent fires? BlackJPI 2658 — 9y
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. PiggyJingles 358 — 9y

Locked by BlueTaslem

This question has been locked to preserve its current state and prevent spam and unwanted comments and answers.

Why was this question closed?