Advertisement
EconomicSerg

TextBox ROBLOX

Feb 4th, 2021
318
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.57 KB | None | 0 0
  1. local box = script.Parent
  2.  
  3. local function onFocus()
  4.     box.BackgroundColor = Color3.new(255, 255, 255) -- We need a "on focus" function, and there is nothing to do when focused
  5. end
  6.  
  7. local function onFocusLost(enterPressed, inputObject)
  8.     if enterPressed then
  9.         local guess = box.Text
  10.         if guess == "roblox" then -- Change  this to whatever you want
  11.             box.Text = "Correct!"
  12.         else
  13.             box.Text = "Wrong!"
  14.         end
  15.     else
  16.         box.Text = ""
  17.     end
  18. end
  19.  
  20. box.Focused:Connect(onFocus)
  21. box.FocusLost:Connect(onFocusLost)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement