So I'm making my own chatting system and to test it whatever text is inside a text box will be filtered and printed. However, if I put an inappropriate word in it still doesn't get filtered. Here is the code inside of the local script in the text box:

script.Parent.FocusLost:Connect(function()
	local msg = script.Parent.Text
	game.ReplicatedStorage.OnChatted:FireServer(msg)
end)

Here is the code inside of the server script:

game.ReplicatedStorage.OnChatted.OnServerEvent:Connect(function(p,msg)


	local filteredmsg = game:GetService("Chat"):FilterStringForBroadcast(msg,p)

	print(filteredmsg)
end)

Someone please help!

2 comments

1

Make sure you are testing in actual Roblox place in RobloxPlayer.exe, filtering does not work inside of the studio. Publish the place and join it, there you can test it.

0

Thanks so much!