How to use the FilterStringAsync's Yield Functions?

function FilterString(String,Player)
	local TextService = game:GetService("TextService")
	local StringToFilter = String
	local FilteredString = TextService:FilterStringAsync(StringToFilter,myPlr.UserId):GetNonChatStringForBroadcastAsync()
	print(FilteredString)
	return FilteredString
end

FilterString("Fuck",game.Players.thelolguy301) -- Sorry for the bad word..  

The result is an unfiltered “Fuck”. (Again, sorry for the language)

4 Likes

When used in Studio, it doesn’t filter. It only filters in live games.

6 Likes

Quick and simple answer. Thank you for the clarification.