Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

Can I hide COREGUI for only one player?

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

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.

1 comment

0

You could just turn it on and off again in that current code for the Died event.

This discussion is preserved as it was. New answers, comments, and votes are closed.