I want to achieve something that will delete the words that are on a blacklist out of the roblox in-game chat, the problems are: 1) I don’t know if this is going work. 2) It keeps telling me that " Chat " is not a vaild member of PlayerGui
I have already tried using a modulescript inside of the chat service with: :RemoveLastMessageFromChannel() but it doesn’t behave the way i want it to, regarding to that i’ve already made a post.
This is currently what i have inside of a Server script:
local BlacklistedWords = {
"word1","word2","word3"
}
game.Players.PlayerAdded:Connect(function(Player)
while wait() do
for i,Child in pairs(Player.PlayerGui.Chat.Frame.ChatChannelParentFrame.Frame_MessageLogDisplay.Scroller:GetChildren()) do
for i,Child in pairs(Child:GetChildren()) do
for i,v in pairs(BlacklistedWords) do
if Child.Frame.Textlabel.Text == string.lower(BlacklistedWords[i]) then
warn("Message found")
Child.Frame:Destroy()
end
end
end
end
end
end)
I think this may be impossible as it is messing with the chat filter that you can be banned from Roblox for doing as some people may use it to bypass the filter.
Yes but the chat is to do with the filter and is all linked up. When I mean bypass the chat filter is some devs may edit the chat to bypass not in the game.
Make sure that a local script is taking care of this. The server can’t access the Chat gui, so that’s probably why you have that error. Also, I found that chat messages have a bunch of spaces in the beginning, so you will need to use something like string.find.
As for what other people are saying, just be sure to make sure that all chat gets filtered. If you’re not otherwise modifying the chat system or making your own, I don’t think you need to worry about that.