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

Text Filtering Problem | The output says 'filteredText' is an instance??

Asked by
N43FGXL 169
4 years ago

So I am currently trying to filter text from a surface gui.

filteredText = TextService:FilterStringAsync(script.Parent.Screen.Info.Text, game.Players.N43FGXL.UserId)

When I print 'filteredText' it is Instance. When I try setting my text to 'filteredText' it doesn't work (obviously because its class is an instance).

Why is this? How do I get the filtered text?

In advance, thanks.

1 answer

Log in to vote
0
Answered by 4 years ago

Hello, N43FGXL. The problem is that you did not use the :GetChatForUserAsync() function. It will make the filtered string instance a string. Try this:

local userId = game:GetService("Players").N43FGXL.UserId

filteredText = TextService:FilterStringAsync(script.Parent.Screen.Info.Text, userId):GetChatForUserAsync(userId)
0
When I do this and I enter profane words, those words are just returned to me when I do print(filteredText) N43FGXL 169 — 4y
Ad

Answer this question