How would I do that?

Hi.
So I was wondering if the following is possible:

In Hebrew, there are few letters which have 2 “types”. One is used at start/middle of a word, the other always at the end( when used).
An example:
“פ” and “ף”.

Now, to not confuse you, let’s say:
“פ” = V1
“ף” = V2

Now, sadly Roblox censors V1(“פ”). And Israeli players have to use V2.

How would I “bypass” that, without disabling filter chat, so that:
-People could use both V1 and V2.
-People still can’t curse.

I have seen a game that has a chat which does this:
If you try to type in English, it won’t pop up above your head. While if you type in Hebrew, it does.
How would I do these?

Some of my players have safe chat, and I still want them to type in Hebrew with filter enabled on, so they cant see bad words etc.

Because currently, when I try to say ‘פ’ [V1] it hashtags it. But when I use ‘ף’[V2] it works.
These 2 letters are important and have quite different uses.

2 Likes

Make a bug report to roblox? Message @Bug-Support although they’re really unresponsive.

Bypassing filters is generally against the rules, even if the filters are wrong.

Anyways. You might be able to replace the problematic character with some token i.e. replace "פ" with "!!ESCAPED" or something, then filter the text, then replace !!ESCAPED with "פ" afterwards.

1 Like

I really wish Roblox fixes that, because there are many Israeli players on the platform, and this makes it harder for some of them to chat with others in-games.

Sounds like a great idea. How should I do that tho?

Please use string.gsub and for this for it to bypass the chat filter. Then, gsub it back to the original.

1 Like

I’ll try. Could you give an example of how should I do that without risking my game?.

I tried this:

local word = "Hello There, Developers!"
local tofind = string.match(word,"D")


local new = word:gsub(tofind,"#")
print(new) -- "Hello There, #evelopers!"

But the filter is annoying. I only need to make it work on buble chat, in the chat itself, I’d prefer to get it censored.

No. Perhaps I didn’t word my reply correctly. I meant replace all of the "v1"s with "v2"s and then code in logic to replace the v2s with the v1’s, when necessary, after filtering it.

But that would hashtag it. Wouldnt it?

You replace them with the non moderated version and then moderate it and then replace the ones that weren’t moderated with the correct ones when the message is displayed.

Sounds promising. But if I replace the ones that werent moderated with the ones that got moderated, what have I done here? it basically would just hashtag it

Like this?

local chat = game:GetService("Chat")
local functionId = "FixTest"

local v1 = "פ"
local v2 = "ף"



local function doFilter(speaker, messageObject, channelName)
	local beforeFiler
	local afterFilter
	
	local tofind = string.match(messageObject.Message,v1)
	local finalMessage
	print(messageObject.Message)
	if tofind then
		local new = messageObject.Message:gsub(tofind,v2)
		finalMessage = new
		print(new)
	else
		finalMessage = messageObject.Message
	end
	
	messageObject.Message = finalMessage
end

local function runChatModule(ChatService)
	ChatService:RegisterFilterMessageFunction(functionId, doFilter)
end

return runChatModule

[Is this the right way, not finished tho?]

local text = game:GetService("TextService")
local chat = game:GetService("Chat")
local functionId = "FixTest"

local v1 = "פ"
local v2 = "ף"

local BadWords = {"פין","פוסי","פוסית","פאק","פיפי","פאקינג","פקינג","פוקינג"}


local function doFilter(speaker, messageObject, channelName)
	local before = string.match(messageObject.Message,v1)
	local finalMessage
	print(messageObject.Message)
	
	if before then
		local beforeMsg = messageObject.Message:gsub(before,v2)
		finalMessage = beforeMsg
		local after = string.match(beforeMsg,v2)
		
		local afterMsg = beforeMsg:gsub(after,v1)
		print("Before: "..beforeMsg,"After: "..afterMsg)
	else
		finalMessage = messageObject.Message
	end
	messageObject.Message = finalMessage
end

local function runChatModule(ChatService)
	ChatService:RegisterFilterMessageFunction(functionId, doFilter)
end

return runChatModule

Not exactly. You use the Roblox moderation system but you take the certain character that was moderated out. Then you put it back in after it was moderated.

1 Like

Oh. I will try it out.
Tho, when I use TextService & FilterAsync functions it returns me nil when I try to print the filtered sring

That means you aren’t using it right. You need to use the functions outside of studio.

1 Like

I did try it outside studio. I filtered the string, used the correct methods but it would still hashtag the words with V1

well did you remove the V1 before it was filtered? you add it back later.

Do you mind showing a script/ example so that I could work out with it?
image

As you can see,
the first message is with V1

And then I replcaed V1 with V2 and put it in ‘Before’, the ‘After’ is after I replaced again v2 with v1 from the ‘before’

But it still will hashtag it on the bubble chat

local text = game:GetService("TextService")
local chat = game:GetService("Chat")
local functionId = "FixTest"

local v1 = "פ"
local v2 = "ף"

local BadWords = {"פין","פוסי","פוסית","פאק","פיפי","פאקינג","פקינג","פוקינג"}


local function doFilter(speaker, messageObject, channelName)
	
	--local filteredTextResult
	
	--local success, errorMessage = pcall(function()
	--	filteredTextResult = text:FilterStringAsync(messageObject.Message, speaker.UserId)
	--end)
	
	--if success then
	--	speaker.PlayerGui.T.G.Text = filteredTextResult
	--	print(filteredTextResult)
	--end
	
	local before = string.match(messageObject.Message,v1)
	local finalMessage
	local afterMsg 
	
	if before then
		local beforeMsg = messageObject.Message:gsub(before,v2)
		finalMessage = beforeMsg
		local after = string.match(beforeMsg,v2)
		afterMsg = beforeMsg:gsub(after,v1)
		print(afterMsg)

		print("Before: "..beforeMsg,"After: "..afterMsg)
	else
		finalMessage = afterMsg
	end
	
	messageObject.Message = finalMessage
end

local function runChatModule(ChatService)
	ChatService:RegisterFilterMessageFunction(functionId, doFilter)
end

return runChatModule

Are you using the filtered text for “Before”? You shouldn’t be doing that.