Hasli4

RBLX. CodeVeriff

Dec 26th, 2025
90
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.02 KB | None | 0 0
  1. local textBox = script.Parent.TextBox
  2. local Frame = script.Parent
  3. local secretWord = "1254"
  4. local colorNormal = Color3.new(1, 1, 1)
  5. local colorWrong = Color3.new(1, 0, 0)
  6. local colorCorrect = Color3.new(0, 1, 0)
  7. textBox.ClearTextOnFocus = true
  8. textBox.Text = ""
  9. textBox.Font = Enum.Font.Code
  10. textBox.PlaceholderText = "Введи секретное слово"
  11. textBox.BackgroundColor3 = colorNormal
  12. local function onFocused()
  13.     textBox.BackgroundColor3 = colorNormal
  14. end
  15. local function onFocusLost(enterPressed, inputObject)
  16.     if enterPressed then
  17.         local guess = textBox.Text
  18.         if guess == secretWord then
  19.             textBox.Text = "Ответ верный"
  20.             textBox.BackgroundColor3 = colorCorrect
  21. wait(4)
  22.             Frame.Visible = false
  23.         else
  24.             textBox.Text = "Неверный ответ"
  25.             textBox.BackgroundColor3 = colorWrong
  26. wait(4)
  27.             Frame.Visible = false
  28.         end
  29.     else
  30.         textBox.Text = ""
  31.         textBox.BackgroundColor3 = colorNormal
  32.     end
  33. end
  34. textBox.FocusLost:Connect(onFocusLost)
  35. textBox.Focused:Connect(onFocused)
  36.  
Add Comment
Please, Sign In to add comment