Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
-1

FilterStringAsync returns "Instance", what's wrong?

Asked by 6 years ago
Edited 6 years ago

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)

0
Format your code Goulstem 8144 — 6y

1 answer

Log in to vote
1
Answered by 6 years ago

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)

0
Thanks for the help! tobyjing2005 107 — 6y
1
bruh accept answer dude LegitimatlyMe 519 — 6y
0
Sorry, I forgot. tobyjing2005 107 — 6y
0
my fella LegitimatlyMe 519 — 6y
Ad

Answer this question