I'm trying to make an script editor but when I press the Tab Button it just creates a space (ASCII 32). It should create a Tab space (ASCII 09), but it doesn't. I've tried to script this:
local uis = game:GetService("UserInputService")
local textbox = script.Parent
uis.InputBegan:Connect(function(key)
if key.KeyCode == Enum.KeyCode.Tab then
print(textbox.CursorPosition)
local s1 = string.sub(textbox.Text, 1, textbox.CursorPosition - 1)
local s2 = " "
local s3 = string.sub(textbox.Text, textbox.CursorPosition, string.len(textbox.Text))
textbox.Text = s1..s2..s3
end
end)
the string called s2 just makes a space. I changed the string to random letters and it works, but not with Tab spaces. What can I do?

2 comments
I don't think Roblox allows that character. Also, inside s2, is that a tab space or just like 5 normal spaces? Because if it's a tab space then Roblox just might not be able to use that character.
its a tab space