How to make a transformers textbox uppercase only

Well, recently I made a system of something with the textbox, but it only detects words in Uppercase, and if by some mistake someone writes in lowercase and it doesn’t work, I want it to be converted to uppercase automatically

1 Like

Just use string.upper:

local text = "tesT"
local transformedText = text:upper()

print(transformedText) --> TEST
2 Likes

Hi. You can try changing the given string to uppercase using the lua command string.upper("Your Given String) or "Your Given String":upper() to change the required string to uppercase. If this helps, please remember to mark it as the solution. If not, feel free to reply and ask any questions. :grinning:

2 Likes

It doesn’t work for me

local Open = false
local keyText = ""

local TextBox = script.Parent.TextBox
local Upper =TextBox.text:upper()

	TextBox:GetPropertyChangedSignal("Text"):Connect(function()
	keyText = TextBox.Text
end)

local UserInputService = game:GetService("UserInputService")

UserInputService.InputBegan:connect(function(keyCode)
	if keyCode.KeyCode.Name == keyText then
		if Open then
			Open = false
			script.Parent.Sombras.Visible = false
		else
			Open = true
			script.Parent.Sombras.Visible = true
		end
	end
end)
1 Like

Make sure to replace that with

local Upper = TextBox.Text:upper()
TextBox:GetPropertyChangedSignal("Text"):Connect(function()
	keyText = TextBox.Text
end)

Did you mean to do

TextBox:GetPropertyChangedSignal("Text"):Connect(function()
	keyText = TextBox.Text:upper()
end)

I’m not sure what the use is for that local Upper =TextBox.text:upper() since nothing uses it

The script tries to change keys, when you put a letter in the textbutton, it captures it and when you press the key you chose, the script is executed, and it only works in uppercase

It doesn’t work, it’s the same

I think that’s what you meant to do then since when add more text or change text in the textbox, it’ll put the uppercase version of it in keyText

1 Like

How? I don’t really understand that

Here’s what I was referring to

TextBox:GetPropertyChangedSignal("Text"):Connect(function()
	keyText = TextBox.Text:upper()
end)

When the Text property changes, it puts the Uppercase version of the text in the TextBox in keyText

But is there no way that when typing it changed automatically ?, or that when I pressed enter I changed it to uppercase?

Ohh you want the TextBox’s input to convert to Uppercase as well. Maybe try this

TextBox:GetPropertyChangedSignal("Text"):Connect(function()
    local text = TextBox.Text:upper()
    TextBox.Text = text
    keyText = text
end)

And with this, whenever you type something and it wasn’t uppercase, it’ll convert it so you can see it uppercased in the TextBox and also set it to the keyText

2 Likes

It works! Thank you very much for helping me, I thank you from the bottom of my heart

1 Like

Anytime! If you have anymore issues don’t be afraid to make another post!

1 Like