Hello so I am trying to filter some text/string which comes through from a player to get announced to everyone else in the server. When I tried to do this It will not filter and just prints out the unfilterd text. Not sure if I am doing it correct as I have not used the filter before. (I don’t get any errors it just prints off the unfilterd text)
local HostShoutEvent = game.ReplicatedStorage.HostStuff.HostShout
local TextService = game:GetService("TextService")
HostShoutEvent.OnServerEvent:Connect(function(plr, ShoutSubmited)
local filteredTextResult = ""
local success, errorMessage = pcall(function()
local filteredMessage = TextService:FilterStringAsync(ShoutSubmited, plr.UserId)
mainfiltertext = filteredMessage:GetNonChatStringForBroadcastAsync()
end)
if success then
print(mainfiltertext)
else
print("Unknow error!")
warn(errorMessage)
end
end)