hello this script dont works can you fix it?: and can i get information a little bit Thanks.
wait() repeat wait(1) if script.Parent.Name == "S" then script.Parent.Visible = false end until false wait()
your checking the name if the TextBox
is S not the text property of it. Also you can just use the FocusLost
event instead of a infinite loop to reduce latency. string.match()
is what your looking for to check if theres a certain character or word inside a string.
--local script, also no need to add wait() TextBox.FocusLost:Connect(function(EnterKeyLostFocus) -- define "TextBox" if EnterKeyLostFocus == true then local lower = string.lower(script.Parent.Text) -- turns all letters in the string to lowercase if string.match(lower,"s") then Frame.Visible = false -- define "Frame" end end end)
FocusLost
fires when the client stops focusing on the textbox, or you could say when the client stops typing in the textbox. I used string.lower
since there could be uppercase or lowercase letters. The enterPressed parameter or what I named EnterKeyLostFocus is a boolean if the client pressed the enter key while typing.