How to make a chat filter that disables when private messaging a friend?

Found a solution to it

local EndReceiver
local function doFilter(speaker, messageObject, channelName)
	if channelName:sub(1,3) == "To " then --Private messaging
		if channelName:sub(4,#channelName) == messageObject["FromSpeaker"] and EndReceiver ~= nil then --Server sending message back to sender
			if not (game.Players:FindFirstChild(messageObject["FromSpeaker"]):IsFriendsWith(game.Players:FindFirstChild(EndReceiver).UserId)) then
				messageObject.Message = filter(messageObject)
				EndReceiver = nil
			end
		else
			EndReceiver = channelName:sub(4,#channelName)
			if not (game.Players:FindFirstChild(messageObject["FromSpeaker"]):IsFriendsWith(game.Players:FindFirstChild(channelName:sub(4,#channelName)).UserId)) then -- Not friends
				messageObject.Message = filter(messageObject)
			end
		end
	else --Not private messaging
		messageObject.Message = filter(messageObject)
	end
end
1 Like

Yes, making your own chat filter is allowed as long as you also use the roblox filter. and i think the reason why many would do this is because it is
really easy to just bypass the filter.

1 Like

Donā€™t bump topics this old. PMā€™ing the person is preferred instead.

1 Like

I highly recommend you not to disable/not using the chat filtering system of roblox because they could take action on your account and your game.

See here https://en.help.roblox.com/hc/en-us/articles/203313120-Safety-Features-Chat-Privacy-Filtering ,
Text and Chat Filtering

despite several explanations people still manage to misintepret the question like you didā€¦