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

Why wont it work? Focuslost

I have been making a chat gui, but my chatbox wont react when it loses focus. It works as it should if I play solo, but upon starting a server/going online it wont work and there is no error outputs:

script.Parent.FocusLost:connect(function(EnterPressed)
	if EnterPressed and script.Parent.Text ~= "" then
		script.Parent.Parent.Value.Value = script.Parent.Text
		script.Parent.Text = "Press T, /, or click here to chat"
	end
	if script.Parent.Text == "" then
		script.Parent.Text = "Press T, /, or click here to chat"
	end
end)

Anyone who can help?

1 answer

Instead of 2 if statements, use an elseif statement. Remove the end on line 5, and replace 'if' on line 6 with 'elseif'

1 comment

0

Not quite what I was looking for... I now know that that is possible, but that is not what I wanted to know.

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