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)
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)
##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)
Thanks for the help!
bruh accept answer dude
Sorry, I forgot.
my fella
This discussion is preserved as it was. New answers, comments, and votes are closed.
1 comment
Format your code