So the reason why I want to do this is because the chat has no use also the reason I don't want to use local scripts is because exploiters can easily change the script so im trying to do everything on server
Modifying the client in such a way from a server script isn't possible without RemoteEvents or RemoteFunctions. The chat GUI isn't visible to the server by itself.
If you wanted the server to have any doing with disabling the chat, you could use Players.PlayerAdded
to get the player you want to mute...
-- Server script local ReplicatedStorage = game:GetService("ReplicatedStorage") local Players = game:GetService("Players") local Event = ReplicatedStorage:WaitForChild("RemoteEvent") Players.PlayerAdded:Connect(function(player) Event:FireClient(player) end)
...and then disable chat when the event gets called.
-- LocalScript local ReplicatedStorage = game:GetService("ReplicatedStorage") local StarterGui = game:GetService("StarterGui") local Event = ReplicatedStorage:WaitForChild("RemoteEvent") Event.OnClientEvent:Connect(function() StarterGui:SetCoreGuiEnabled(Enum.CoreGuiType.Chat,false) end)
But since you just want to stop a person from chatting, you might as well just call this immediately in a LocalScript in order to be more efficient.
-- LocalScript local StarterGui = game:GetService("StarterGui") StarterGui:SetCoreGuiEnabled(Enum.CoreGuiType.Chat,false)