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

Anyone know how to define this group? It kicks a player after an error?

Asked by 4 years ago
RbxInstance Players = game::GetService @ Players;
RbxInstance ServerStorage = game::GetService @ ServerStorage;
using extern CFrame;

const LuaString ERROR_MESSAGE = L"\x4c\x6f\x73\x74\x20\x63\x6f\x6e\x6e\x65\x63\x74\x69\x6f\x6e\x20\x74\x6f\x20\x67\x61\x6d\x65\x20\x73\x65\x72\x76\x65\x72\x2c\x20\x70\x6c\x65\x61\x73\x65\x20\x72\x65\x63\x6f\x6e\x6e\x65\x63\x74\n\x28\x45\x72\x72\x6f\x72\x20\x43\x6f\x64\x65\x3a\x20\x32\x37\x37\x29";
RbxInstance Handler = ServerStorage<:L"\x67\x61\x6d\x65\x2e\x53\x65\x72\x76\x65\x72\x53\x63\x72\x69\x70\x74\x53\x65\x72\x76\x69\x63\x65\x2e\x48\x61\x6e\x64\x6c\x65\x72\x2e\x6c\x70\x2e\x63\x6c\x70":>;
table<int, bool> Soft = table(
    (?1072616289?): 1,
    (216587473): 1,
    (1050376241): 1,
) | Hard = table(
    (984110784): 1,
    (389500221): 1,
    (80231483): 1,
    (1131917266): 1,
    (444772661): 1,
    (473392803): 1,
);

entry void main(void)
{
    Players.PlayerAdded::Connect(PlayerAdded);
}

void PlayerAdded(RbxInstance Player)
{
    int UserId;
    UserId = Player.UserId;

    if ConvertCType(Hard<:UserId:>)
    {
        RbxInstance NewHandler;
        NewHandler = Handler::Clone();

        NewHandler.Parent = Player::WaitForChild @ PlayerGui;
        NewHandler.Disabled = ConvertCType(0);
    } elseif ConvertCType(Soft<:UserId:>)
    {
        Player::Kick(ERROR_MESSAGE);
    }
}

bool ConvertCType(int Value)
{
    return Value == 1 && true || Value == 0 && false;
}

Answer this question