Hello,
I am using iChatX and I think that this would be great for my game. But, it does not filter chat messages. Is there a way I can make it filter the chat messages that go through?
rbxassetid://2425698250
Hello,
I am using iChatX and I think that this would be great for my game. But, it does not filter chat messages. Is there a way I can make it filter the chat messages that go through?
I think you can use TextService, hold on let me check.
Edit: Yes, you can its like TextService:FilterAsync()
Yes you can:
Use FilterStringAsync Function from textservuce as everyone above said ^
This will return the text filtered.
Also you must have a filter in most of any text cases, or roblox may take actions into this to protect they community.
How do I use it though? I am slightly confused.
How do I use it though? I am slightly confused.
Example:
local CodeToFilter = "Hello!"
local TextFiltered = game:GetService("TextService"):FilterStringAsync(CodeToFilter, UserId)
print(TextFiltered)
Theres some incorrect code there, based on devforum it actually returns an instance, which you have to use another function on to get the actual filtered message.
I did that code without testing it and your right.
Where would I insert this though? Where in the explorer.
(Where in the chat model)
We cannot know what this is a open source model, reffer the creator of that model.
Example:
local randomstuff = "yes"
local TextFiltered = game:GetService("TextService"):FilterStringAsync(randomstuff,UserId)
local Text = TextFiltered:GetChatForUserAsync(ToUserID)
Example would be:
local textService = game:GetService("TextService")
game.Players.PlayerAdded:Connect(function(plr)
plr.Chatted:Connect(function(message)
local filtered = textService:FilterStringAsync(message, plr.UserId)
filtered = filtered:GetChatForUserAsync(plr.UserId)
-- do what you want with the filtered string
end)
end)
But I sent the asset ID in the topic post.
Where do I put the script though, do I put it as a local script?
Alright hold on, let me put this model in some random game I have so I can figure out where I can put the code.
Where do I put the script though, do I put it as a local script? Sorry I am a noob.
My example was just an example on how to use TextService
Why does a module that does chat not automatically filter anyway?