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

Typing in anything into a textbox then press a button like enter then it shows up in a text label?

Hi I am trying to make it so what ever a player types in the textbox then you press a button and it shows up like a post on facebook or twitter. Can you help me?

2 answers

✓ Accepted answer

Use the FocusLost event in textboxes then you make it add a textlabel with the text of the textbox. Here's an example:

TextBox.FocusLost:connect(function(enterPressed) -- if enterPressed is true that means they pressed enter ;)
	if enterPressed then
		newLabel(TextBox.Text) -- example function for creating new label with the textbox's text in it
	end
end)

2 comments

0

dude whats newLabel?

0

nvm

This is what I came up with but its not working. Any help?

script.Parent.Parent.FeedBackFrame.TextFrame.TextBox.FocusLost:connect(function(enterPressed) -- if enterPressed is true that means they pressed enter ;)
    if enterPressed then
        script.Parent.Parent.TextLabel(script.Parent.Parent.FeedBackFrame.TextBox.Text)
    end
end)

1 comment

0

I was using newLabel as an example function that creates a new label somewhere, i can't really make a script unless you gave us a proper example to help you with.

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