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

Can I hide COREGUI for only one player?

Asked by 10 years ago

I'm trying to make a generic copy of murder mystery, got everything down but I need to make sure dead players can't chat.

1 answer

Log in to vote
1
Answered by
adark 5487 Badge of Merit Moderation Voter Community Moderator
10 years ago

You're going to want to use the SetCoreGuiEnabled method of the StarterGui.

In a LocalScript:

local Player = Game.Players.LocalPlayer
if not Player.Character then Player.CharacterAdded:wait() end

Player.Character.Humanoid.Died:connect(function()
    Game.StarterGui:SetCoreGuiEnabled(Enum.CoreGuiType.Chat, false)
end)

You'll still have to turn chat back on when they are spawned into the game, again from a LocalScript, but that code will disable the chat for someone that has died.

0
You could just turn it on and off again in that current code for the Died event. iaz3 190 — 10y
Ad

Answer this question