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

Why isn't the text of the TextBox showing in another TextBox?

Asked by
iAviate 20
9 years ago

I made a surfaceGUI with a TextBox, and I wanted to be able to input text directly into the TextBox - unfortunately this feature is locked. So instead, I tried to make a script which launched a GUI with a TextBox, and the text entered into the GUI TextBox would appear on the surfaceGUI TextBox.

Here's the script that's in the surfaceGUI TextBox - fairly simple - which won't take the text:

while true do
script.Parent.Text = game.Workspace.GuiGiver.GUI.TextBox.Text
end

Am I using the wrong "repeat" loop?

2 answers

Log in to vote
0
Answered by 9 years ago

For a while loop, you should use a wait() statement for it can crash the game from infinitely looping without any time between each iteration. To fix this, just add in wait() between line 1 and line 2. If you have any other questions, just leave a comment and I can help.

0
Thanks for the help - the wait() fixed my crashing problem, iAviate 20 — 9y
0
But the surfaceGUI TextBox still won't display what I type into the GUI TextBox in-game. Thanks in advance. iAviate 20 — 9y
Ad
Log in to vote
0
Answered by
woodengop 1134 Moderation Voter
9 years ago

When writing a Script you need to write it in a Way where Studio Can Read It, for Example, When you put script.Parent.Text = ,Normally, Studio would see it as a quote, Lets say I want to add a Little Script in the Text, in this Case we would need two dots like this .., Now lets move on to the Script

gui = script.Parent -- Just to be simple, and Clean
gui2 = game.Workspace.GuiGiver

--I won't be using a Loop
gui.Text = ""..gui2.Gui.TextBox.Text--Remember that the .. means INCLUDE

Hope this helped!

0
Hi, thanks for the help, but the surfaceGUI textbook still isn't updating LIVE IN-GAME when a user inputs text into the GUI textbox. Thanks, iAviate iAviate 20 — 9y
0
accept the answer pls woodengop 1134 — 9y
0
It doesn't really answer the question iAviate 20 — 9y
0
Easy, Use the Changed event. woodengop 1134 — 9y
0
It still doesn't work iAviate 20 — 9y

Answer this question