Filtering Module - A simple filtering module for filtering texts

What is Filtering Module?

A module designed to filter text beyond standard chat functionalities.

image

How to Setup

Insert the module anywhere in your game (Ex. Replicated Storage)

Usage

Server Script:

-- Path to the module
local Module = require(game.ReplicatedStorage.FilteringModule)

game.Players.PlayerAdded:Connect(function(Player)
	local Text = "Fuc!"

	-- Filter the text using the module
	local FilteredText = Module.Filter(Player, Text)

	-- Send the filtered text
	game:GetService("ReplicatedStorage").RemoteEvent:FireClient(Player,FilteredText)
end)

Local Script:

game:GetService("ReplicatedStorage").RemoteEvent.OnClientEvent:Connect(function(Text)
	-- Apply the text
	script.Parent.Text = Text
end)

Result:
image

Module

FilteringModule - Creator Store (roblox.com)
OR
FilteringModule.rbxm (1.0 KB)

From 1 to 5, How would you rate the module?

  • 5
  • 4
  • 3
  • 2
  • 1

0 voters

1 Like

i dont really see a reason why anyone would need a module for a 1 line function

1 Like

I appreciate the feedback. While the function itself might seem simple, the module is designed to make text filtering easier for developers.

This would be better fit as a tutorial! Instead, teach developers how to use Roblox’s filtering system. That’s all this module does in the 40 lines it has.

1 Like

Thanks for the suggestion. Unlike a tutorial, this module provides a quick and efficient solution for text filtering, saving developers time and enhancing game safety.

???

local Module = require(game.ReplicatedStorage.FilteringModule)
local FilteredText = Module.Filter(Player, Text)

takes more lines and is longer to type than

game.TextService:FilterStringAsync("sample", userid)

I never understood Roblox’s game.TextService:FilterStringAsync, I don’t like this function for the many code writing to just to get a filtered string.

This is why I use ChatService:FilterStringForBroadcast for all cases, it’s simply much easier, better and only requires 1 line rather than having to write 3 or 4 lines.

I find this module actually useful, and I thank you for it. because I never understood that Roblox API.

1 Like

I designed my module with beginners in mind, focusing on making the functionality easy to use rather than optimizing for professionals

1 Like

Do you know why the user ID is required for filtering strings sent from users and between users? Roblox’s P2P filter is based on user age and location* (sometimes). Some users for example cannot say numbers, while most can. Those other filter methods exist for a reason, not just to look pretty.

1 Like

Hey Alexinite, thanks for the clarification! I appreciate you suggesting me to take another look at the TextFilter documentation.

You’re absolutely right, user ID and age/location filtering are essential for broader chat filtering, especially for experiences going global with players from various countries and languages.

While my focus was on public content like announcements where those filters might not be as crucial, and experiences directed to the English Audience, I understand the broader use cases now.

While my focus was on public content like announcements where those filters might not be as crucial, I understand the broader use cases now. For my specific needs, filtering specific words and phrases using ChatService:FilterStringForBroadcast seems most efficient for public content. However, I completely see the value of the other methods for broader chat scenarios, particularly in global experiences.