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

Why is the FocusLost event not working on the textbox?

Asked by
Master_JJ 229 Moderation Voter
7 years ago
Edited 7 years ago

I am trying to script a passcode gui, but for some reason the enterPressed parameter for the FocusLost event is not working.

local frame = script.Parent
local enter = script.Parent:WaitForChild("Enter")
local container = script.Parent:WaitForChild("PasscodeContainer")
local passcode = container:WaitForChild("Passcode")
local text = container.Text

print("Variables loaded.")

container.FocusLost:Connect(function(enterPressed)
    if enterPressed then
        text = container.Text
        print(text)
    else
        print(text)
    end
end)
0
I noticed it works without checking if enter was pressed. Master_JJ 229 — 7y
0
There shouldn't be a problem. Did you put it in a server script? It should be in a local. H4X0MSYT 536 — 7y

Answer this question