How to make it so when pressing the Tab button it doesn't add a space in the chat?

I was having some trouble with this as well but I figured out a hacky way to do it, hopefully this works for you.

local UserInputService = game:GetService("UserInputService")

local TextBox = script.Parent
local StoredText

local function UpdateTextBox()
	StoredText = TextBox.Text
	task.wait()
	TextBox.Text = StoredText
end

UserInputService.InputBegan:Connect(function(k)
	local key = k.KeyCode.Name
	if k.UserInputType == Enum.UserInputType.Keyboard then
		if key == "Tab" then
			UpdateTextBox()
		end
	end
end)

3 Likes

First of all, thank you so much for responding. It’s crazy how much time has passed without any valid explanations or any answers on how to solve it and I think this may be the answer and if it is I will let you know and mark it as a solution.

I appreciate it.

It worked, thanks so much again for your help! :slight_smile:

1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.