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()
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()
#Problem
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.
This discussion is preserved as it was. New answers, comments, and votes are closed.
5 comments
You could use GetPropertyChangedSignal("Text") aswell depending on if you need to check for the S whenever it's there or when they finish typing it
yeah, i was actually gonna use that, but then then i realized it fires when your tying. so i used FocusLost instead
i think thats what he wanted
this is a test
wydm\