Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

How can I remove a single players chat?

Asked by 4 years ago

I've tried removing the chat via PlayerGui, but it says that SetCoreGuiEnabled doesn't apply there. I've tried StarterGui, but that removes the chat from every player.

Below is the code, It's in a Local Script.

local FE = game.ReplicatedStorage:WaitForChild("FreezeEvent")

FE.OnClientEvent:Connect(function(x) -- x represents a value that tells the script if it should freeze or thaw the player.
    if x == "freeze" then
        plr.PlayerGui:SetCoreGuiEnabled("Chat",false) -- tried this, doesn't work.
    elseif x == "thaw" then
        game.StarterGui:SetCoreGuiEnabled("Chat",true) -- removes all player's chat.
    end
end)

1 answer

Log in to vote
3
Answered by
karlo_tr10 1233 Moderation Voter
4 years ago
game.StarterGui:setCoreGuiEnabled("Chat",false)

is actually the solution, if it's inside of local script like it should be in your case it will only hide it for that player, I assume that you fired it to all players so that's why it's hidden for all-

0
Nice one. Xapelize 2658 — 4y
Ad

Answer this question