Hello! I’m currently working on a plugin. I am trying to make the player “focused” on a TextBox, however there is a problem:
Whenever I focus the player in the TextBox through the code, Studio bugs out. For example, you can type as expected, but hitting Backspace will delete whatever you selected. Modifier keys also do not work. O and I are not working either. Instead, they move your camera.
Here is the code I am using:
local TextBox = widget.TextBox
local TextButton = widget.TextButton
local function CaptureFocus()
TextBox:CaptureFocus()
end
TextButton.Activated:Connect(CaptureFocus)
Help would be appreciated, if there is something I am missing here. Thanks!
There’s a lot of stuff so I’ll send what I can. Dropdown is the Frame that handles the button interactions. Dropdown.Edit: TextButton → Focus on aaa.MessageBox
what about using UserInputService with the input and processed?
local UserInputService = game:GetService("UserInputService")
UserInputService.InputBegan:Connect(function(input, proc)
if proc then return end
--// the rest of your text thingy code
end)
lowk not sure if that will work
wait aint that is your doing something in game only
Not sure. I will be able to try the code tomorrow because I have to go now. Check this topic if you’re still gonna be around tomorrow.
On the other hand, you are saying use UserInputService and detect the mouse position relative to the button? Just a reminder that this is for a plugin. Yet again, UserInputService is unreliable in plugins. I will try though.