How do I stop chat appearing in custom chat?

How do I fix this? The chat shows in the private chat as well!

You probably have an event for .Chatted somewhere that’s doing that? least, that’s what I believe it is from what you’ve sent. Could you send the code for the radio?

repeat wait() until game.Players.LocalPlayer and game.Players.LocalPlayer.Character and game.Players.LocalPlayer.Character:findFirstChild(“Humanoid”) and game.Players.LocalPlayer:findFirstChild(“PlayerGui”)

if not game.Players.LocalPlayer:findFirstChild(“ChatzLogs”) then local cl = script.Parent:Clone() cl.Parent = game.Players.LocalPlayer cl.Name = “ChatzLogs” cl.LocalScript:Destroy() end

function Chat(name, text, color, textcolor)

for i = 1, 5 do

script.Parent[tostring(i)].Text = script.Parent[tostring(i+1)].Text

script.Parent[tostring(i)].TextColor3 = script.Parent[tostring(i+1)].TextColor3

script.Parent[tostring(i)].Txt.Text = script.Parent[tostring(i+1)].Txt.Text

script.Parent[tostring(i)].Txt.Position = script.Parent[tostring(i+1)].Txt.Position

script.Parent[tostring(i)].Txt.TextColor3 = script.Parent[tostring(i+1)].Txt.TextColor3

end

script.Parent[“6”].Text = name … “:”

script.Parent[“6”].TextColor3 = color

script.Parent[“6”].Txt.Position = UDim2.new(0,script.Parent[“6”].TextBounds.X + 5,0,0)

script.Parent[“6”].Txt.TextColor3 = textcolor

script.Parent[“6”].Txt.Text = text

if script.Parent[“6”].Txt.TextBounds.X + script.Parent[“6”].TextBounds.X + 5 > (script.Parent.Parent.AbsoluteSize.X - 19) then repeat script.Parent[“6”].Txt.Text = script.Parent[“6”].Txt.Text:sub(1,script.Parent[“6”].Txt.Text:len()-1) until script.Parent[“6”].Txt.TextBounds.X + script.Parent[“6”].TextBounds.X + 5 <= (script.Parent.Parent.AbsoluteSize.X - 19) script.Parent[“6”].Txt.Text = script.Parent[“6”].Txt.Text … “…” end

if game.Players.LocalPlayer:findFirstChild(“ChatzLogs”) then

for i = 1, 6 do

–ignorethis

end

end

end

function findPlr(str) for i, v in ipairs(game.Players:children()) do if v.Name:lower():sub(1,str:len()) == str:lower() then return v end end return nil end

function LoadCheck(plr,text,color)

if text:lower() == “/help” and plr == game.Players.LocalPlayer then

Chat(“(Help)”,“Use ‘@[name] [msg]’ to whisper, use ‘#[msg]’ to team chat.”,Color3.new(0,1,0),Color3.new(0,1,0))

elseif text:lower() == “Version” and plr == game.Players.LocalPlayer then

Chat(“(TRV)”,“{hone Gui Version 2”,Color3.new(0,1,0),Color3.new(0,1,0))

elseif text:sub(1,1):lower() == “#” and plr.TeamColor == game.Players.LocalPlayer.TeamColor then

Chat("(TEAM) "…plr.Name,text:sub(2),color.Color,color.Color)

elseif text:sub(1,1):lower() == “@” and text:sub(2):find(" “) and text:sub(2):find(” “)>1 and findPlr(text:sub(2,text:sub(2):find(” ")-1)) then

local newplr = findPlr(text:sub(2,text:sub(2):find(" ")-1)) if newplr ~= game.Players.LocalPlayer and plr ~= game.Players.LocalPlayer then return end

Chat("(MSG) “…plr.Name,text:sub(text:sub(2):find(” ")+1),Color3.new(.5,.75,1), Color3.new(1,1,1))

elseif text:sub(1,1):lower() ~= “@” and text:sub(1,1):lower() ~= “#” and text:lower() ~= “/help” and text:lower() ~= “Glory To TRV” then Chat(plr.Name,text,color.Color,Color3.new(1,1,1))

end

end

function CheckSafeChat(plr) plr.ChildAdded:connect(function(obj) if obj:IsA(“StringValue”) and obj.Name == “ChatzMsg” then LoadCheck(plr, obj.Value, plr.TeamColor) end end) end

game.Players.ChildAdded:connect(function(plr) if plr and plr:IsA(“Player”) then CheckSafeChat(plr) plr.Chatted:connect(function(text) LoadCheck(plr, text, plr.TeamColor) end) end end)

for i, plr in ipairs(game.Players:children()) do CheckSafeChat(plr) plr.Chatted:connect(function(text) LoadCheck(plr, text, plr.TeamColor) end) end

I didn’t code it so Im not quite sure what is happening.

I see 2 .Chatted events, remove those, they’re at the very end

Ah Yes. But when I remove them the code no longer works?

When you removed them, did you remove the entire event or just .Chatted? The last 2 parts of the code,

game.Players.ChildAdded:connect(function(plr) if plr and plr:IsA(“Player”) then CheckSafeChat(plr) plr.Chatted:connect(function(text) LoadCheck(plr, text, plr.TeamColor) end) end end)

for i, plr in ipairs(game.Players:children()) do CheckSafeChat(plr) plr.Chatted:connect(function(text) LoadCheck(plr, text, plr.TeamColor) end) end

Change these to

game.Players.ChildAdded:connect(function(plr)
	if plr and plr:IsA("Player") then
		CheckSafeChat(plr) 
	end 
end)

for i, plr in ipairs(game.Players:children()) do
	CheckSafeChat(plr) 
end
1 Like

OMG TY SO SO SO SO SO SO SO MUCH! I have been trying to fix this for a long time as you can probabbly tell :slight_smile:

1 Like

I’m very glad that fixed your issue! If you have anymore issue sdon’t be afraid to make another post!!

1 Like

Thank you very much :slight_smile:

1 Like

Sorry to bother you again. When you put something in the chat it no longer appears in the radio however now other players cannot see what I put in the radio?

Wait was it always like that even before removing the Chatted thing?

No. It just started as I changed the code.

Let me check the output and see if it has any errors.

There are no errors in the output :thinking:

1 Like

Okay, that’s odd. I think we should first move this to messages since the answer this post wanted was given so we can also not flood the chat with something that is concluded

Edit: Actually wait I can’t message you? I guess we have to continue here. How does your code look like now after the edit?

repeat wait() until game.Players.LocalPlayer and game.Players.LocalPlayer.Character and game.Players.LocalPlayer.Character:findFirstChild(“Humanoid”) and game.Players.LocalPlayer:findFirstChild(“PlayerGui”)

if not game.Players.LocalPlayer:findFirstChild(“ChatzLogs”) then local cl = script.Parent:Clone() cl.Parent = game.Players.LocalPlayer cl.Name = “ChatzLogs” cl.LocalScript:Destroy() end

function Chat(name, text, color, textcolor)

for i = 1, 5 do

script.Parent[tostring(i)].Text = script.Parent[tostring(i+1)].Text

script.Parent[tostring(i)].TextColor3 = script.Parent[tostring(i+1)].TextColor3

script.Parent[tostring(i)].Txt.Text = script.Parent[tostring(i+1)].Txt.Text

script.Parent[tostring(i)].Txt.Position = script.Parent[tostring(i+1)].Txt.Position

script.Parent[tostring(i)].Txt.TextColor3 = script.Parent[tostring(i+1)].Txt.TextColor3

end

script.Parent[“6”].Text = name … “:”

script.Parent[“6”].TextColor3 = color

script.Parent[“6”].Txt.Position = UDim2.new(0,script.Parent[“6”].TextBounds.X + 5,0,0)

script.Parent[“6”].Txt.TextColor3 = textcolor

script.Parent[“6”].Txt.Text = text

if script.Parent[“6”].Txt.TextBounds.X + script.Parent[“6”].TextBounds.X + 5 > (script.Parent.Parent.AbsoluteSize.X - 19) then repeat script.Parent[“6”].Txt.Text = script.Parent[“6”].Txt.Text:sub(1,script.Parent[“6”].Txt.Text:len()-1) until script.Parent[“6”].Txt.TextBounds.X + script.Parent[“6”].TextBounds.X + 5 <= (script.Parent.Parent.AbsoluteSize.X - 19) script.Parent[“6”].Txt.Text = script.Parent[“6”].Txt.Text … “…” end

if game.Players.LocalPlayer:findFirstChild(“ChatzLogs”) then

for i = 1, 6 do

–ignorethis

end

end

end

function findPlr(str) for i, v in ipairs(game.Players:children()) do if v.Name:lower():sub(1,str:len()) == str:lower() then return v end end return nil end

function LoadCheck(plr,text,color)

if text:lower() == “/help” and plr == game.Players.LocalPlayer then

Chat(“(Help)”,“Use ‘@[name] [msg]’ to whisper, use ‘#[msg]’ to team chat.”,Color3.new(0,1,0),Color3.new(0,1,0))

elseif text:lower() == “Version” and plr == game.Players.LocalPlayer then

Chat(“(TRV)”,“{hone Gui Version 2”,Color3.new(0,1,0),Color3.new(0,1,0))

elseif text:sub(1,1):lower() == “#” and plr.TeamColor == game.Players.LocalPlayer.TeamColor then

Chat("(TEAM) "…plr.Name,text:sub(2),color.Color,color.Color)

elseif text:sub(1,1):lower() == “@” and text:sub(2):find(" “) and text:sub(2):find(” “)>1 and findPlr(text:sub(2,text:sub(2):find(” ")-1)) then

local newplr = findPlr(text:sub(2,text:sub(2):find(" ")-1)) if newplr ~= game.Players.LocalPlayer and plr ~= game.Players.LocalPlayer then return end

Chat("(MSG) “…plr.Name,text:sub(text:sub(2):find(” ")+1),Color3.new(.5,.75,1), Color3.new(1,1,1))

elseif text:sub(1,1):lower() ~= “@” and text:sub(1,1):lower() ~= “#” and text:lower() ~= “/help” and text:lower() ~= “Glory To TRV” then Chat(plr.Name,text,color.Color,Color3.new(1,1,1))

end

end

function CheckSafeChat(plr) plr.ChildAdded:connect(function(obj) if obj:IsA(“StringValue”) and obj.Name == “ChatzMsg” then LoadCheck(plr, obj.Value, plr.TeamColor) end end) end

game.Players.ChildAdded:connect(function(plr)

if plr and plr:IsA(“Player”) then

CheckSafeChat(plr)

end

end)

for i, plr in ipairs(game.Players:children()) do

CheckSafeChat(plr)

end

I can see my own messages but I can’t see other people’s messages

If you only added what I mentioned, then I’m not sure what it could be, is the type of chat you’re using right now needed for your game or can you make due with Bubble Chat and you can readd the chatted events back?

It could also maybe be that it only sets it for you cause localscript? I can understand why it worked when there were the .Chatted events, but hmm