StarterGui:SetCore("ChatActive") not working

i think the new update broke this method, this is the code im using:

local UserInputService = game:GetService("UserInputService")
local StarterGui = game:GetService("StarterGui")
local chatEnabled = true

local function toggleChat()
	chatEnabled = not chatEnabled
	StarterGui:SetCore("ChatActive", chatEnabled)
end

UserInputService.InputBegan:Connect(function(inp, gpe)
	if gpe then return end
	if inp.KeyCode == Enum.KeyCode.Z then
		toggleChat()
	end
end)

try this
game:GetService(“StarterGui”):SetCoreGuiEnabled(Enum.CoreGuiType.Chat, false)

ChatActive requires a coregui handeler set and the new chat doesn’t do that, only LegacyChat does