CaptureFocus() doesn't work with Roblox default chat disabled?

I’m trying to make a custom chat for my game.

The issue is that when I disable Roblox’s default chat, clicking (/) no longer calls CaptureFocus() to my chat box.

Below is a video of my custom chat working with CaptureFocus, with Roblox’s chat box enabled.

Below is an image of what I’d like to accomplish, although CaptureFocus with (/) no longer works due to me disabling Roblox’s chat box I’m guessing?

Script for CaptureFocus:

game:GetService("UserInputService").InputEnded:connect(function(input, gameProcessedEvent)
	if gameProcessedEvent ~= false then
		if input.KeyCode == Enum.KeyCode.Slash then
			MessageBox:CaptureFocus()
		end
	end
end)

Local Script in StarterGui disabling Roblox’s chat:

local StarterGui = game:GetService("StarterGui")
StarterGui:SetCoreGuiEnabled(Enum.CoreGuiType.Chat, false)

How would I get CaptureFocus to work with Roblox’s chat disabled?
Thanks in advance.

I think your issue may be

Try removing that if statement or change it so it checks if it is false and see if it fixes anything?

That or you may need to use BackSlash instead of Slash

The if statement was the problem. Forgot about the gameprocessedevent lol, thank you.

1 Like