How can I test if text filtering works in my experience?

I would like to test the filtering in text service, but I don’t know how. I though “love” was a good test word, but it doesn’t get replaced by ###.

Is there a keyword that I can use to test the experience filtering without risking some kind of moderation flagging of my account?

Code is simple enough:

	local filteredText
	if player then
		-- if obby belongs to a player, set the player's display name as default name of the obby
		filteredText=player.DisplayName
		-- for user obbies, filter the name for forbidden words
		if signText and string.len(signText)>0 then
			local filteredTextResult:TextFilterResult

			local success, errorMessage = pcall(function()
				-- allow 1-15 characters
				filteredTextResult = TextService:FilterStringAsync(string.sub(signText,1,15), player.UserId,Enum.TextFilterContext.PublicChat)
			end)
			if success then
				filteredText=filteredTextResult:GetNonChatStringForBroadcastAsync()
			else
				warn("Error filtering text:", signText, ":", errorMessage)
			end
		end
	else
		-- obby name comes from script, will not be filtered
		filteredText=signText
	end

Have you tried testing it in a server (not in studio) ? Filtering doesn’t work in studio.

2 Likes

I guess “love” is OK, at least in my language. I picked another test word that I was sure about, and it does work.

1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.