Okay, so im trying to use a Custom Chat i found.. (Ofcourse im going to edit it..) But first im trying to make it works with FilterStringAsync.. But when i try it it gives errors and stuff ;-; tried to look up a custom chat with FilterStringAsync but couldnt really find one :/
Please help me with this
local chats = script.Parent.Chats
local last
function newChat(msg,plr)
if #msg > 0 then
for i, c in pairs(chats:GetChildren()) do
c.Position = c.Position - UDim2.new(0, 0, 0.1, 0)
end
local newMessage = script.Message:clone()
if #chats:GetChildren() == 10 then
chats:GetChildren()[1]:Destroy()
end
if plr.Name == "" then
newMessage.TextColor3 = script.Owner.Value
newMessage.Text = "[OWNER] " .. plr.Name ..": ".. msg
elseif plr.Name == "" or plr.Name == "" or plr.Name == "" then
newMessage.TextColor3 = script.Admin.Value
newMessage.Text = "[ADMIN] " .. plr.Name ..": ".. msg
elseif game:GetService("GamePassService"):PlayerHasPass(plr, 0)then
newMessage.TextColor3 = script.VIP.Value
newMessage.Text = "[VIP]" .. plr.Name ..": ".. msg
else
newMessage.Text = plr.Name ..": ".. msg
end
newMessage.Position = UDim2.new(0, 0, 0.9, 0)
newMessage.Parent = chats
last = newMessage
end
end
function join(plr)
for i, c in pairs(chats:GetChildren()) do
c.Position = c.Position - UDim2.new(0, 0, 0.1, 0)
end
local newMessage = script.Message:clone()
if #chats:GetChildren() == 10 then
chats:GetChildren()[1]:Destroy()
end
newMessage.Text = "[CONSOLE] " .. plr.Name .. " joined the server!"
newMessage.TextColor3 = script.CONSOLE.Value
newMessage.Position = UDim2.new(0, 0, 0.9, 0)
newMessage.Parent = chats
last = newMessage
end
function left(plr)
for i, c in pairs(chats:GetChildren()) do
c.Position = c.Position - UDim2.new(0, 0, 0.1, 0)
end
local newMessage = script.Message:clone()
if #chats:GetChildren() == 10 then
chats:GetChildren()[1]:Destroy()
end
newMessage.Text = "[CONSOLE] " .. plr.Name .. " left the server."
newMessage.TextColor3 = script.CONSOLE.Value
newMessage.Position = UDim2.new(0, 0, 0.9, 0)
newMessage.Parent = chats
last = newMessage
end
game.Players.PlayerAdded:connect(function(plr)
join(plr)
end)
game.Players.PlayerRemoving:connect(function(plr)
left(plr)
end)
game.Players.PlayerAdded:connect(function(plr)
plr.Chatted:connect(function(msg)
newChat(msg, plr)
end)
end)
for i, player in pairs(game.Players:GetPlayers()) do
player.Chatted:connect(function(msg)
newChat(msg, player)
end)
end

4 comments
The message is being created via the function 'newChat', so it would be best to filter the string there using FilterStringBroadcast, here is a pretty neat tutorial: https://www.youtube.com/watch?v=Ph1nCEIlZ2c
the problem is that if i try to add :FilterStringForBroadcast or :FilterStringAsync to the function it says "Unknown Global: 'newChat'"
I heard FilterStringAsync is deprecated, I agree with YabaDabaD0O
Watch the language! Profanity is not allowed on the website. https://scriptinghelpers.org/help/community-guidelines