i have made a chat system but im failing to figure out a way to filter a message before sending it. not sure if this makes any sense. in the script below i want the local FilteredMessage to actually return a filtered message, not just the message
local Event = game:GetService("ReplicatedStorage").Chat_SendMessage
local Tween = game:GetService("TweenService")
Event.OnServerEvent:Connect(function(Player, Message)
for increment , selectedPlayer in pairs(game:GetService("Players"):GetPlayers()) do
local Chat = selectedPlayer.PlayerGui.Chat.MessageClip.Template:Clone()
local FilteredMessage = Message
Chat.Parent = selectedPlayer.PlayerGui.Chat.MessageClip
Chat.Text = [[<font color="#55aaff">[]] .. Player.Name .. "]:" .. "</font> " .. FilteredMessage
Chat.Visible = true
Tween:Create(Chat, TweenInfo.new(0.3), {TextTransparency = 0}):Play()
Tween:Create(Chat, TweenInfo.new(0.3), {TextStrokeTransparency = 0.8}):Play()
wait(25)
Tween:Create(Chat, TweenInfo.new(0.3), {TextTransparency = 1}):Play()
Tween:Create(Chat, TweenInfo.new(0.3), {TextStrokeTransparency = 1}):Play()
wait(0.5)
Chat:Destroy()
end
end)