SetCoreGuiEnabled permanently disables chat box

local function openGui()
	if open then return end
	game.StarterGui:SetCoreGuiEnabled(Enum.CoreGuiType.All, false)
	--game:GetService("StarterGui"):SetCore("ResetButtonCallback", false)
	open = true
	openEvent:FireServer()
end

local function closedGui()
	if not open then return end
	game.StarterGui:SetCoreGuiEnabled(Enum.CoreGuiType.All, true)
	--game.StarterGui:SetCoreGuiEnabled(Enum.CoreGuiType.Chat, true)
	game:GetService("StarterGui"):SetCore("ResetButtonCallback", true)
	open = false
	exitEvent:FireServer()
end

equipButton.Activated:Connect(equip)
openButton.Activated:Connect(openGui)
exitButton.Activated:Connect(closedGui)

character.Humanoid.Died:Connect(function()
	closedGui()
end)

This is my script for a little inventory system I am making, where I am wanting the CoreGui’s to be disabled, and it for the most part works as intended, except for one part of it.

When a player joins the game the chatbox no longer appears despite there being a clear chat option.
af

Players also cannot chat at all, and the script fully disables the chat when its called and reenables the button. The chatbox however doesn’t even show up before the functions where it is affected are even run.