So I thought to try to make my own custom chat, and I manage to do that and got it working, but now I’m trying to filter the chat just in case someone says a cuss word but its not working
here’s the server script
local ReplicatedS = game:GetService("ReplicatedStorage")
local ChatMessageRemote = ReplicatedS.Remotes:WaitForChild("ChatMessageRemote")
local Filtered
ChatMessageRemote.OnServerEvent:Connect(function(Player, Text, Thumbnail)
pcall(function()
Filtered = game:GetService("TextService"):FilterStringAsync(Text, Player.UserId)
Filtered = Filtered:GetNonChatStringForBroadcastAsync()
end)
if not Filtered then return end
ChatMessageRemote:FireAllClients(Player, Text, Thumbnail)
end)
here’s the local script if you need to see it
local Thumbnail = game:GetService("Players"):GetUserThumbnailAsync(
Player.UserId,
Enum.ThumbnailType.HeadShot,
Enum.ThumbnailSize.Size420x420
)
PlayerImage.Image = Thumbnail
TextBox.FocusLost:Connect(function()
if TextBox.Text ~= "" then
ChatMessageRemote:FireServer(TextBox.Text, Thumbnail)
TextBox.Text = ""
end
end)
ChatMessageRemote.OnClientEvent:Connect(function(Player, Text, Thumbnail)
local NewMessage = ChatMessage:Clone()
NewMessage.PlayerName.Text = tostring(Player)
NewMessage.TextFrame.TextBox.Text = Text
NewMessage.PlayerImage.Image = Thumbnail
NewMessage.Parent = ScrollingFrame
end)