Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

Make The Frame Not visible if the letter in box is S?

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()

1 answer

✓ Accepted answer

#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.

5 comments

0

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

0

yeah, i was actually gonna use that, but then then i realized it fires when your tying. so i used FocusLost instead

0

i think thats what he wanted

0

this is a test

0

wydm\

This discussion is preserved as it was. New answers, comments, and votes are closed.