How to prevent bypass?

From that code that is it, should I add a if statement like:

local FilteredStr = pcall(TextService.FilterStringAsync, TextService, Messages, Player.UserId, Enum.TextFilterContext.PublicChat) 
if filteredText then
		return FilteredStr:GetChatForUserAsync(Player.UserId)
	else
		return ""
	end
end

No, you just need to use filteredText as the message when you make the NPCs chat.

Odd, what could be the issue then?

Can you post the code that makes the bots appear and talk as you mentioned in the first post?

Sent on Direct Messages. @Blokav

Alright, I see the issue it looks like you’re still using the Messages and not the filtered text.

Try using this:

for index, text in ipairs(Messages) do
	local tfResult = game:GetService("TextService"):FilterStringAsync(text, Player.UserId)
	local filteredText = tfResult:GetNonChatStringForBroadcastAsync()
	Messages[index] = filteredText
end

This will replace the text in the Messages array with their filtered values.

1 Like

Tysm! I needed this quite badly!

@reteyetet Cheers, thank you so much! :smile:

1 Like

Please keep this thread on-topic. What you guys are responding right now is not related to the topic at all.
I also want to remind you guys of the Forum Rules.

3 Likes