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

Unfinished String (using Dictionaries)?

Asked by
DeadToMe 105
9 years ago

I'm attempting to create some commands, however, I am getting the error of "unfinished string near '<eof>'".

The script is as follows.

players = {
    ['3610599'] = {
        name = 'DeadToMe';
        id = 3610599;

        rank = 5;
        title = 'Owner';
    };
};


function playerHandler(player)
    local data = players[tostring(player.userId)];

    if (data) then
        if (data.banned) then
            player:Kick();

            print('Kicked player ' .. player.Name .. '(id: ' .. player.userId .. '): banned.');
        else
            print('Found data for player ' .. player.Name .. '(id: ' .. player.userId .. ').');
        end;
    else
        players[tostring(player.userId)] = {
            name = player.Name;
            id = player.userId;

            rank = 0;
            title = 'Guest';
        };

        print('Created data for player ' .. player.Name .. '(id: ' .. player.userId .. ').');
    end;

    player.Chatted:connect(function(msg)
        print(msg);
    end);
end;


for _, player in pairs(game:GetService('Players'):GetPlayers()) do
    playerHandler(player);
end;

EDIT: The following causes the same error.

players = { };
1
Not sure what you are talking about. This code is not giving me any errors. NotsoPenguin 705 — 9y
0
I don't know why exactly it is giving me the error. It shouldn't give me any error. alas, it is. DeadToMe 105 — 9y

Answer this question