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

How do I detect when a GUI Textbox's text changes?

I want to be able to enter a name of a player, then after I enter the name it will automatically run my script onto the player.

I have a TextBox GUI that you are supposed to enter the name into. But instead of having another button to click "Go" I would rather have it automatically execute.

If you are curious, it will automatically display a picture of that person.

2 answers

✓ Accepted answer

Use the Changed event.

script.Parent.Changed:connect(function()
	if game.Players:findFirstChild(script.Parent.Text) then 
		print("execute")
	end
end)

Hmm, I would probly use GUINAME.FocusLost:connect(function() end) 'Use for TextBoxes' for it, but the coding for GUIs currently aren't working right now, I'd wait a while after Roblox fixes the coding for GUIs, because right now the coding isn't working and is broken at the moment, but it may be back up soon. Hope this helped!

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