How do I make the frame visible after entering the correct password?
I created a script that checks text in TextBox. I also created a script that allows you to close a window.
First script:
01 | local textBox = script.Parent |
06 | local secretWord = "roblox" |
07 | local colorNormal = Color 3. new( 1 , 1 , 1 ) |
08 | local colorWrong = Color 3. new( 1 , 0 , 0 ) |
09 | local colorCorrect = Color 3. new( 0 , 1 , 0 ) |
12 | textBox.ClearTextOnFocus = true |
14 | textBox.Font = Enum.Font.Code |
15 | textBox.PlaceholderText = "Put here your word!" |
16 | textBox.BackgroundColor 3 = colorNormal |
18 | local function onFocused() |
19 | textBox.BackgroundColor 3 = colorNormal |
22 | local function onFocusLost(enterPressed, inputObject) |
24 | local guess = textBox.Text |
25 | if guess = = secretWord then |
26 | textBox.Text = "1 match was found" |
27 | textBox.BackgroundColor 3 = colorCorrect |
31 | textBox.Text = "no result found" |
32 | textBox.BackgroundColor 3 = colorWrong |
37 | textBox.BackgroundColor 3 = colorNormal |
41 | textBox.FocusLost:Connect(onFocusLost) |
42 | textBox.Focused:Connect(onFocused) |
and the shorter second one
1 | script.Parent.MouseButton 1 Click:Connect( function () |
2 | script.Parent.Parent.Visible = false |
These two scripts are local scripts. I want the window to pop up after typing the correct phrase.
How do I make the frame visible after entering the correct password?