How do you check if a player is typing in a TextBox? I have certain keys bind to open menus in my game and this is an issue for when I need the player typing in a TextBox.
EDIT; This is what I currently have, but it doesn't work...
userInput = game:GetService("UserInputService")
focused = false
userInput.TextBoxFoxused:connect(function()--fires when the player focuses on a textBox
focused = true
print("We live!")
end)
userInput.TextBoxFoxusedReleased:connect(function()--fires when the player unfocuses from a textBox
focused = false
print("We off")
end)
userInput.InputBegan:connect(function(input)
print("Hi!")
if input.UserInputType == Enum.UserInputType.Keyboard and input.UserInputState == Enum.UserInputState.Begin and input.KeyCode == Enum.KeyCode.M and focused == false then
onClicked()
end
end)
script.Parent.MouseButton1Click:connect(onClicked)

3 comments
Looks good but isn't working for me.. Did I do something wrong? (I put it in the question)
yes, i spelled stuff wrong, I'll edit
Ok, should work now