Sorry I cant show you the actual script because I dont want it to be leaked, but heres what I got:
I have a function hooked up to make it so that when you press the Enter key, It prints whats inside a Textbox.
The only problem is, you have to click enter twice when typing in the Textbox. Once to Exit out of the Textbox, and once to print. How do I make it so that you only need to press Enter once?
I guess I can put this small part of the script down:
Num=1
Mouse.KeyDown:connect(function(Key) -- When the player presses a key
if Key == string.char(13) then -- If the player Pressed the enterkey
AddText(Num.."> "..Textbox.Text) -- Thats a custom function that works. It prints to a custom Console.
Textbox:CaptureFocus()
Num=Num+1
end
end)

3 comments
o CaptureFocus will Capture the focus of the Textbox. Its a Roblox function.
edited, the first param of the FocusLost function is a bool that says whether or not enter was pressed to release the TextBox. The second argument is the InputObject that caused the TextBox to lose focus. @your latest comment: I know. I just don't know why you're doing it.
Yeah the thing returns true, u dont need to do anything else. Thanks for the Help!