On key press, focus a Textbot

it will Focus the textbox but also put / in the box
image

Can you do print(script.Parent.Text) right after the :CaptureFocus() just to see what you get?

its appearing in the textbox but not sending to output, if i press enter with it how it is it also sends a / as a message

Aight. This is a bit jank but I tested it and it should work:

uis.InputBegan:Connect(function(input)
	if input.KeyCode == Enum.KeyCode.Slash then
		script.Parent:CaptureFocus()
		script.Parent:GetPropertyChangedSignal("Text"):Wait()
		script.Parent.Text = string.sub(script.Parent.Text, 0, string.len(script.Parent.Text)-1)
	end
end)
2 Likes

your a godsend!! thank you so much, can confirm this is now functional.

1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.