I'm trying to make a filter for my custom chat but every time I try to filter something it throws an error.
--LocalScript that send the message to the server
local LocalPlayerName = game:GetService("Players").LocalPlayer.Name
local Rank = "(Test Rank)"
local Text = "im trying to filter this: d7sjfix8snd" --text
game:GetService("ReplicatedStorage").SendMessage:FireServer(LocalPlayerName,Rank,Text)
The script above and below work fine
--Script that receives the message
game:GetService("ReplicatedStorage").SendMessage.OnServerEvent:Connect(function(PlrWhoSent,Plr,Rank,Message)
local TextService = game:GetService("TextService")
local Msg = ""
local success,err = pcall(function()
FilteredString = TextService:FilterStringAsync(Message,PlrWhoSent.UserId)
end)
if err then
warn("Failed to filter text: "..err)
Msg = "<Failed To Filter Text>"
else
Msg = FilteredString
end
game:GetService("ReplicatedStorage").SendMessage:FireAllClients(Plr,Rank,Msg)
end)
This is where the error occurs
--LocalScript that receives the message
game:GetService("ReplicatedStorage").SendMessage.OnClientEvent:Connect(function(Plr,Rank,Msg)
local FilteredMessage = Msg:GetChatForUserAsync(game:GetService("Players").LocalPlayer.UserId)
--[[script.Parent.MessageReady:Fire(FilteredMessage)
This sends it to the script that handles the messages]]
I tried looking for a solution, but i didnt find anything.

5 comments
ok why u are making a custom filter?
its for my custom chat
ok
u can send the error output type?
oh i see the error ion the title srry