I am currently using the Roblox filter to filter some text on a textbox. In one script, I filter two textboxes at around the same time but I only get a filter result for one of them. What could be the issue?
1 Like
It would be nice if you can post some code so we can look at it and see if there are any errors. We don’t know what’s wrong if you haven’t sent your code
local success, errorMessage = pcall(function()
filteredText = TextService:FilterStringAsync(Description, UserId):GetChatForUserAsync(UserId) -- Description doesn't work
end)
if success then
wait(1)
Booth.Screen.Info.Description.Text = filteredText
else
warn("Error while filtering: "..Description.." Error Message:"..errorMessage)
Booth.Screen.Info.Description.Text = " "
end
wait(1)
local success, errorMessage = pcall(function()
filteredText2 = TextService:FilterStringAsync(GroupName, UserId):GetChatForUserAsync(UserId) -- GroupName filters and works
end)
if success then
wait(1)
Booth.Screen.Info.GroupName.Text = filteredText2
else
warn("Error while filtering: "..GroupName.." Error Message:"..errorMessage)
Booth.Screen.Info.GroupName.Text = " "
end
See if this works. I’ve tested in studio and my code work as expected.
local success, errorMessage = pcall(function()
filteredText = TextService:FilterStringAsync(Description, UserId)
end)
if success then
Booth.Screen.Info.Description.Text = filteredText:GetNonChatStringForBroadcastAsync()
else
warn("Error while filtering: "..Description.." Error Message:"..errorMessage)
Booth.Screen.Info.Description.Text = " "
end
local success, errorMessage = pcall(function()
filteredText2 = TextService:FilterStringAsync(GroupName, UserId)
end)
if success then
Booth.Screen.Info.GroupName.Text = filteredText2:GetNonChatStringForBroadcastAsync ()
else
warn("Error while filtering: "..GroupName.." Error Message:"..errorMessage)
Booth.Screen.Info.GroupName.Text = " "
end