Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

ReleaseFocus doesn't work ?

Asked by 8 years ago
Edited 8 years ago

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.

0
Why not just change the Text property without doing the focus? theres no use to focus if you dont need player interaction. RubenKan 3615 — 8y
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. fireboltofdeathalt 118 — 8y

1 answer

Log in to vote
0
Answered by 8 years ago

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.

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. fireboltofdeathalt 118 — 8y
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) fireboltofdeathalt 118 — 8y
0
Nope. Didn't work. fireboltofdeathalt 118 — 8y
0
That should have worked. Is this in a localscript MrLonely1221 701 — 8y
Ad

Answer this question