Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

FilterStringAsync returns "Instance", what's wrong?

How do I fix this?

local textService = game:GetService("TextService")

game.ReplicatedStorage.FilterText.OnServerEvent:connect(function(player, text)

pcall(function() 

	print(textService:FilterStringAsync(text, player.UserId)) 

end) 

end)

1 comment

0

Format your code

1 answer

✓ Accepted answer

##FilterStringAsync FilterStringAsync returns not a string, but a TextFilterResult.


###TextFilterResult TextFilterResults is a better way to get filtered strings. A TextFilterResult has 3 main methods.


###GetChatForUserAsync GetChatForUserAsync is a method that filters a string that is intended to display for a certain user.

This is best used for private chats.


###GetNonChatStringForBroadcastAsync GetNonChatStringForBroadcastAsync is a method that filters a string that is shown to everyone in a non-chat context.

This is best used for public signs (such as naming a restaurant, or giving yourself another nickname)


###GetNonChatStringForUserAsync GetNonChatStringForUserAsync is a method that filters a string that is shown to a certain user in a non-chat context.

This is best used for private signs (signs, like mentioned above, that is only shown to that one user)

4 comments

0

Thanks for the help!

1

bruh accept answer dude

0

Sorry, I forgot.

0

my fella

This discussion is preserved as it was. New answers, comments, and votes are closed.