Help with filtering text

I want to filter my text

When I filter my text it shows it for like 1 second then filters it.
What it does after 0.4 second
image

Before 0.4 second
image

I have tried roblox.com with my friends.

I am trying to make my own message command to filter but when it filters it just shows it my code fires a remote event and function to filter the text. It has like a 0.4 second delay before filtering the message.

--// LocalScript
local TextService = game:GetService("TextService")
local Player = game:GetService("Players").LocalPlayer
local FilterText = game.Workspace.AdminFolder.FilterText
local SetText = game.Workspace.AdminFolder.SetText
	
local filtered = FilterText:InvokeServer(script.Parent.Text)
script.Parent.Text = filtered
SetText:FireServer(filtered)

--//ServerScript
local TextService = game:GetService("TextService")
local FilterText = script.Parent.FilterText
local SetText = script.Parent.SetText

FilterText.OnServerInvoke = function(player,filteredText)
	print("Function")
	local filteredTextResult = TextService:FilterStringAsync(filteredText,player.UserId)
	return filteredTextResult:GetNonChatStringForBroadcastAsync()
end

SetText.OnServerEvent:Connect(function(player,newText)
	print("Remote")
	script.Parent.LocalCodeExecutor.MessageGui.BackgroundFrame.Message.Text = newText
end)

Can you show me an example? :grinning_face_with_smiling_eyes:

What would I put if it is a success ? Becuase this confused me all I am saying is that it filters just doesnt do it instantly instead it just waits 0.4 seconds before filtering

Ok I will try your code out I was in school

But I do have a question :grinning_face_with_smiling_eyes:

What Woudl I put in this area? I do not know what to do if it is a success

.FilteringStringAsync does not work would it?

Does not work lol :grinning_face_with_smiling_eyes: no filtering