The hub just states that it returns an ‘instance’ but I can’t find how to actually get the filtered string.
local FilteredName = TextService:FilterStringAsync(name, player.UserId)
PlayerData.Character['Roleplay Name'].Value = FilteredName
And is there a difference between the TextService and Chat FilterStringAsync?
blokav
(blokav)
March 1, 2020, 4:02am
#2
Copy-and-pasted since I already answered someone else’s post about this:
Use a remote to send the text to the server. Call TextService:FilterStringAsync(userId, text), passing in the id of the user who sent it and the text that was sent over. You might want to wrap this in a pcall statement since it is asynchronous and dependent on a service which might fail.
It will return a TextFilterResult object. Since I’m assuming the text will be showed to everyone as a pet’s name you should use TextFilterResult:GetNonChatStringForBroadcastAsync(). That will return the filtere…
If your use-case is different then ignore the part about remotes. See @Halalaluyafail3 ’s reply about the methods that come with the TextFilterResult object.
It should return a TextFilterResult , which has the methods: GetChatForUserAsync , GetNonChatStringForBroadcastAsync , and GetNonChatStringForUserAsync .
In regards to the difference between the methods, chat methods are most likely just legacy.
Edit: Looks like the main difference is just that there is a resolvable instance
https://devforum.roblox.com/t/new-filtering-service-textservice/57817?u=halalaluyafail3