Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

How to make a text box that once a letter is placed in it. It will be recognized once pressed?

Like the title said I'm trying to make a text box a player can type in. This player will specifically be able to type a letter into it and once they do they will be able to use in game. As in when the player does press the button that is equaled to the button the game will detect it. Though I'm not sure how to do this. I've seen some examples. One example is Strucid. In Strucid your able to exactly what I just said. Any help will be very appreciated. This is my attempt.

Local Script

local keybindbox = script.Parent
local Player = game.Players.LocalPlayer
local UIS = game:GetService("UserInputService")




UIS.InputBegan:Connect(function(Input,gpe)
	local T = keybindbox.Text
	if Input.KeyCode == Enum.KeyCode.T and not gpe then
		print("Player pressed whatever was in keybindbox")
	end
end)

1 answer

Hmm, Im sorta new to this but I'll try.

local keybindbox = script.Parent
local Player = game.Players.LocalPlayer
local UIS = game:GetService("UserInputService")

UIS.InputBegan:Connect(function(Input)
	local Pressed = Input.KeyBind
	if Pressed == Enum.KeyCode..keybindbox.Text then
		print("Something")
	end
end)

This could not really work but give it a try, you never know!

4 comments

0

I put two dots after KeyCode

0

No sorry it didn't work. I got this error: 12:00:28.167 - KeyBind is not a valid member of InputObject

0

Yea, only put one.

0

Oof

This discussion is preserved as it was. New answers, comments, and votes are closed.