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

I can't make message from player lower. How to fix that?

Asked by
Diltz_3 75
5 years ago

So.... I want to make filter from Russians Words (because some filtering is not take)

And I can't make string.lower() Where's my error?

local Black_list = {
    ["???????? ????"] = true,
    ["???????? ?????"] = true,
    ["???????? ???"] = true,
    ["???????? ?????"] = true,
    ["???????? ???????"] = true,
    ["????????"] = true,
    ["???????? ????"] = true,
}

local TeleportService = game:GetService("TeleportService")

game.Players.PlayerAdded:Connect(function(Player)
    Player.Chatted:Connect(function(Message)
        if Black_list[string.lower(Message)] then
            print("Is bad word")
        else
            print("Not bad word")
        end
    end)
end)
0
It should work fine. Perhaps you're looking for string.find? Amiaa16 3227 — 5y

1 answer

Log in to vote
0
Answered by 5 years ago

You are doing string.lower() in the index of a dictionary. Try this:

local Black_list = {
    ["???????? ????"] = true,
    ["???????? ?????"] = true,
    ["???????? ???"] = true,
    ["???????? ?????"] = true,
    ["???????? ???????"] = true,
    ["????????"] = true,
    ["???????? ????"] = true,
}

local TeleportService = game:GetService("TeleportService")

game.Players.PlayerAdded:Connect(function(Player)
    Player.Chatted:Connect(function(Message)
    local LowerMessage = string.lower(Message)
        if Black_list[string.lower(LowerMessage)] then
            print("Is bad word")
        else
            print("Not bad word")
        end
    end)
end)
0
Sorry, you didn't helped me. I'm tried. Diltz_3 75 — 5y
Ad

Answer this question