Hello.
I am trying to find out how to FillterText. I have looked at the Dev Hub and this Post.
Can some one help me, Thanks.
Hello.
I am trying to find out how to FillterText. I have looked at the Dev Hub and this Post.
Can some one help me, Thanks.
Hello @Dan_foodz ,
So to use filter text, its a client based function works on local script.To try it you can do something like:
local textservice = game:GetService("TextService")
local textforfilter = "Hello this will get filtered"
local playerid = game.Players.LocalPlayer.UserId
local filteredtext = textservice:FilterStringforBroadcastAsync(textforfilter,playerid)
print(filteredtext)
Now if you want it to filter from server side you can do:
local message = "hi"
local filtered = message:FilterMessageAsync(message,fromplayerid)
print(filtered)
This function can be used on server sided scripts.
XD, I am trying to use it on the server, thank you for that info
Got it, thank you for the help!
FilterStringAsync takes 3 parameters: string to filter, the userid of the player sending, and context(private chat or not)
FilterStringAsync returns a TextFilterResult
TextFilterResults have 3 important functions, each which returns the filtered string: