Can you locally disable chat?

I am trying to script a TextButton so that once it’s pressed it locally disables the players chat.

Is it possible to locally disable a players chat via TextButton, etc.?

My code is inside of a LocalScript under a TextButton and once the button is pressed it doesn’t do anything, I am not sure what is going wrong but suspect it is because it’s not local.

(My code listed below)

script.Parent.MouseButton1Click:Connect(function()
	game:GetService("StarterGui"):SetCore("ChatActive, false")
end)

Any help is greatly appreciated! Thanks

yeah think that’s the problem aswell

Hey, you’re almost there! SetCore takes two parameters, and you’ve got just one as the comma separating the two is inside the quotation marks. Placing false after the quotation marks will fix your issue with using SetCore.

script.Parent.MouseButton1Click:Connect(function()
	game:GetService("StarterGui"):SetCore("ChatActive",false)
end)

It should also be noted that you can use StarterGui:SetCoreGuiEnabled() to set whether the chat is seen/enabled. This can be done locally and an example of how to implement this can be seen below:

script.Parent.MouseButton1Click:Connect(function()
	game:GetService("StarterGui"):SetCoreGuiEnabled(Enum.CoreGuiType.Chat,false)
end)
1 Like
local chat = game:GetService(“Chat”)

script.Parent.MouseButton1Click:Connect(function()
 chat = false
end

Check if this works?

It worked! I now understand what I did wrong and what was causing it not to work. Thankyou!

1 Like