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

How would I make a textbox available to type in when a key is pressed?

I have no idea how to get started with that. Could someone give me a major hint or point me to a robloxwiki for that?

2 comments

0

I would love to help but I don't fully understand your problem.

0

Oh, I'm sorry. Like for example, the core chat GUI. When you press the "/" key, it automatically lets you enter in what you want to say. But say I wanted to do that for any other GUI and I have a textbox. If I press a certain key, how could I make it automatically jump to letting you input text? Hope that's more clear. :)

1 answer

✓ Accepted answer

There is a function which focuses on the text box when called, :CaptureFocus(). Here is an example:

local player = script.Parent.Parent.Parent.Parent
local mouse = player:GetMouse()
local textbox = script.Parent

mouse.KeyDown:connect(function(key)
	if key == "/" then--if the key is '/' then
		textbox:CaptureFocus() --User can type
	end
end)

If you are new to keys you can go to this link here : http://wiki.roblox.com/index.php?title=Taking_keyboard_input Which shows how to get keyboard input. Hope i helped!

1 comment

0

Thank you so much!

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