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

How do I transfer the text from TextBox to TextLabel?

Asked by 4 years ago

Okay, so I have a TextBox that the player has to enter text into. And then that text will appear on a TextLabel that the player cannot edit. I thought it was just gonna be something simple.. for example

script.Parent.Text = (script.Parent.Parent.TextBox.Text)

is there a way I can make this work?

0
It should be as simple as that, you just don't need the () moo1210 587 — 4y
0
well it isnt working.. im pretty sure its because the text box is wonky D0CTOR_CHIL 21 — 4y
0
are you trying to update it the instant the text box changs or something like you type and then submit? Erie20 102 — 4y
0
i want it to submit D0CTOR_CHIL 21 — 4y
0
in that case you wouod need to create a guibutton. i think you should check out some of the tutorials here:https://developer.roblox.com/learn-roblox/user-interface Erie20 102 — 4y

2 answers

Log in to vote
0
Answered by 4 years ago

So pretty much what @bittersweetfate did, except put it into a local script:

while wait(0.5) do
    script.Parent.Text = script.Parent.Parent.TextBox.Text
end

Just put that code into a local script, and you're done!

0
why wouldn't it be in a local script? bittersweetfate 142 — 4y
0
Because Doctor Chill Might not have put it into a local script. Cynical_Innovation 595 — 4y
Ad
Log in to vote
0
Answered by
Erie20 102
4 years ago

This forum post may help you

Just basically do what the above said and maybe have and event that fires everytime the text is changed

On a localscript

textgui = script.Parent.Text
texbox = script.Parent.Parent.TextBox

textbox.GetPropertyChangedSignal("Text"):Connect(function()
-- code
end)

Answer this question