local textBox = script.Parent
local secretWord = "Testing1"
local colorWrong = Color3.new(1, 0, 0) -- red
local colorCorrect = Color3.new(0, 1, 0) -- green
local colorNormal = Color3.new(42, 84, 126) -- blueish
textBox.ClearTextOnFocus = false
textBox.Text = ""
textBox.Font = Enum.Font.Code
textBox.PlaceholderText = ""
textBox.BackgroundColor3 = colorNormal
local function onFocused()
textBox.BackgroundColor3 = colorNormal
end
local function onFocusLost(enterPressed, inputObject)
if enterPressed then
local guess = textBox.Text
if guess == secretWord then
script.Parent.TextLabel.Visible = false
if script.Parent.Text == "Testing1" then
script.Parent.TextLabel.Visible = true
else
print("Test")
end
textBox.Text = "TestRight"
textBox.BackgroundColor3 = colorCorrect
else
textBox.Text = "TestWrong"
textBox.BackgroundColor3 = colorWrong
end
else
textBox.BackgroundColor3 = colorNormal
end
end
textBox.FocusLost:Connect(onFocusLost)
textBox.Focused:Connect(onFocused)
How come the textbox turns white instead of blue?

1 comment
ty