Why Wont This Custom Chat Send The Message? I Believe It May Have Something To Do With The Filtering Being Done On Client Side? Is That Bad? But There Was No Errors Too
code here:
game:GetService('UserInputService').InputBegan:connect(function(key)
if key.KeyCode == Enum.KeyCode.Slash then
if Focused ~= true then
script.Parent.ChatBar:CaptureFocus()
Focused = true
repeat
wait(.1)
script.Parent.ChatBar.Text = ""
until script.Parent.ChatBar.Text == ""
end
end
end)
script.Parent.ChatBar.FocusLost:connect(function(enter) -- this is what sends and filters the code
if enter == true then
Focused = false
local Msg = script.Parent.ChatBar.Text
local LoweredMsg = string.lower(script.Parent.ChatBar.Text)
local FilteredMessage = game.Chat:FilterStringForBroadcast(Msg, game.Players.LocalPlayer)
local count = 0
repeat
wait(.1)
for index,value in ipairs(BlockedWords) do
local NewFilter string.find(string.lower(FilteredMessage), value)
if NewFilter ~= nil then
Msg = string.gsub(Msg, value, "*")
wait(.1)
Msg = string.gsub(Msg, "#", "*")
end
end
until count == 200
game:GetService('Lighting').ChatFunctions.PublicChat:Invoke(Msg, game:GetService('Players').LocalPlayer)
end
end)
game:GetService('Lighting').ChatFunctions.PublicChat.OnInvoke:connect(function(msg,plr)
if Chatcount == 0 then
local msgclone = game:GetService('Lighting').ChatMsg:Clone()
if plr == "TheGrimDeathZombie" then
local rainbow = game:GetService('Lighting').RainbowText:Clone()
rainbow.Parent = msgclone
msgclone.Text = "[Founder]"..msg
elseif plr == "SamgladiatorRB" then
local rainbow = game:GetService('Lighting').RainbowText:Clone()
rainbow.Parent = msgclone
msgclone.Text = "[Youtuber]"..msg
elseif plr == "DrKaiBlox123" then
local rainbow = game:GetService('Lighting').RainbowText:Clone()
rainbow.Parent = msgclone
msgclone.Text = "[Co-Founder]"..msg
elseif plr == "Player1" then
local rainbow = game:GetService('Lighting').RainbowText:Clone()
rainbow.Parent = msgclone
msgclone.Text = "[Founder]"..msg
end
end
end)

2 comments
You should have an appropriate description that properly addresses your question.
ok, i'll make one now then