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

ReleaseFocus doesn't work ?

If I captureFocus a textbox, I cannot use releasefocus on it. ReleaseFocus(true) still works, but they still type in the textbox.

I've tried: Spamming release focus; Setting textbo to not be visible; (Works, but when changed back to visible, still focused) Neither of these methods work. (I tried a third one, but I forgot)

tb = script.Parent
tb:CaptureFocus()
tb.Text = "Sudo"
tb:ReleaseFocus(true)
-- for i = 1,10 do wait() tb:ReleaseFocus(true) end

Note: ReleaseFocus works if I don't use CaptureFocus. Thank you. Also, I tried to put on roblox forums, but the post made after mine got 19 replies and 75 views, while mine had 6 (Mostly me) and 0 replies. Anyways, thanks.

2 comments

0

Why not just change the Text property without doing the focus? theres no use to focus if you dont need player interaction.

0

Okay issue is; I tried that. But it doesn't register with release focus. I am trying to force someone to run tet in a command box.

1 answer

All that should be working. You don't need to set the value for ReleaseFocus

local tb = script.Parent;
tb:CaptureFocus();
tb.Text = "Sudo";
tb:ReleaseFocus();

This should work. If it does I'm glad I could help and would really appreciate it if you could accept this as the answer. If you find this confusing feel free to ask any questions you have.

4 comments

0

You just gave me back my script, which doesn't work. I tested it, it doesn't work. CaptureFocus doesn't trigegr Focused, so ReleaseFocus doesn't work. I need a fix for this.

0

Though, I may of just solved my issue. Thank you for trying to help, though. (double though, triple though, quadruple though, I'll stop now. Mainly since idunno the 5 one)

0

Nope. Didn't work.

0

That should have worked. Is this in a localscript

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