Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

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

Asked by 8 years ago

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

Log in to vote
0
Answered by
Ryzox 220 Moderation Voter
8 years ago

Use the FocusLostevent 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)
0
dude whats newLabel? docrobloxman52 407 — 8y
0
nvm docrobloxman52 407 — 8y
Ad
Log in to vote
0
Answered by 8 years ago

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)

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. Ryzox 220 — 8y

Answer this question